diff --git a/.gitignore b/.gitignore index b6e4761..d4af666 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +# IDEs and editors +.idea/ diff --git a/README.md b/README.md index 559990c..0d832ab 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,19 @@ This repository is a kind of documentation about my knowledge about Python, here Python official page: https://www.python.org/ -- [Python Functions](https://github.com/lbrealdev/0k-python/tree/main/python-functions) -- [Python Classes and OOP](https://github.com/lbrealdev/0k-python/tree/main/python-OOP) -- [Python Data Structures](https://github.com/lbrealdev/0k-python/tree/main/python-data-structure) -- [Python Packaging and Dependency Management](https://github.com/lbrealdev/0k-python/tree/main/python-packaging) -- [Python Builds](https://github.com/lbrealdev/0k-python/tree/main/python-builds) -- [Python Virtual Environments](https://github.com/lbrealdev/0k-python/tree/main/python-virtualenvs) -- [Python Enhancement Proposals](https://github.com/lbrealdev/0k-python/blob/main/python-peps) -- [Python Testing](https://github.com/lbrealdev/0k-python/blob/main/python-testing) -- [Python GUI](https://github.com/lbrealdev/0k-python/blob/main/python-gui) -- [Python TUI](https://github.com/lbrealdev/0k-python/blob/main/python-tui) -- [Python Blogs](https://github.com/lbrealdev/0k-python/blob/main/python-blogs) -- [Python Web](https://github.com/lbrealdev/0k-python/blob/main/python-web) +- ## Python + - [functions](python/functions/README.md) + - [classes and OOP](python/oop/README.md) + - [data structures](python/data-structure/README.md) + - [packaging](python/packaging/README.md) + - [builds](python/builds/README.md) + - [venvs](python/virtualenvs/README.md) + - [peps](python/peps/README.md) + - [tests](python/testing/README.md) + - [gui](python/gui/README.md) + - [tui](python/tui/README.md) + - [blogs](python/python-blogs/README.md) + - [web](python/web/README.md) ## Python Resources diff --git a/python-blogs/README.md b/python-blogs/README.md index a6c05b3..692bf92 100644 --- a/python-blogs/README.md +++ b/python-blogs/README.md @@ -7,18 +7,12 @@ - [Python's Built-in Exceptions: A Walkthrough With Examples](https://realpython.com/python-built-in-exceptions/) - [Ruff: A Modern Python Linter for Error-Free and Maintainable Code](https://realpython.com/ruff-python/) - [Python's assert: Debug and Test Your Code Like a Pro](https://realpython.com/python-assert-statement/) -- [Python's property(): Add Managed Attributes to Your Classes](https://realpython.com/python-property/) -- [Using Python Optional Arguments When Defining Functions](https://realpython.com/python-optional-arguments/) -- [How Do You Choose Python Function Names?](https://realpython.com/python-function-names/) - [Python Mappings: A Comprehensive Guide](https://realpython.com/python-mappings/) - [Logging in Python](https://realpython.com/python-logging/) - [Asynchronous Iterators and Iterables in Python](https://realpython.com/python-async-iterators/) -- [How to Use Generators and yield in Python](https://realpython.com/introduction-to-python-generators/) - [Defining Main Functions in Python](https://realpython.com/python-main-function/) - [Python's Built-in Functions: A Complete Exploration](https://realpython.com/python-built-in-functions/) - [Python Command-Line Arguments](https://realpython.com/python-command-line-arguments/) -- [Python Metaclasses](https://realpython.com/python-metaclasses/) -- [Python Classes: The Power of Object-Oriented Programming](https://realpython.com/python-classes/) - [Python Protocols: Leveraging Structural Subtyping](https://realpython.com/python-protocol/) - [Duck Typing in Python: Writing Flexible and Decoupled Code](https://realpython.com/duck-typing-python/) - [Python's pathlib Module: Taming the File System](https://realpython.com/python-pathlib/) @@ -37,17 +31,30 @@ - [Build a Command-Line To-Do App With Python and Typer](https://realpython.com/python-typer-cli/) - [Control Flow Structures in Python](https://realpython.com/python-control-flow/) - [Thinking Recursively in Python](https://realpython.com/python-thinking-recursively/) -- [Defining Your Own Python Function](https://realpython.com/defining-your-own-python-function/) -- [How Can You Structure Your Python Script?](https://realpython.com/python-script-structure/) - [Python Textual: Build Beautiful UIs in the Terminal](https://realpython.com/python-textual/) - [How to Get a List of All Files in a Directory With Python](https://realpython.com/get-all-files-in-directory-python/) -- [What Is Python's __init__.py For?](https://realpython.com/python-init-py/) - [How to Read User Input From the Keyboard in Python](https://realpython.com/python-keyboard-input/) - [Build a Contact Book App With Python, Textual, and SQLite](https://realpython.com/contact-book-python-textual/) - [Python Scope and the LEGB Rule: Resolving Names in Your Code](https://realpython.com/python-scope-legb-rule/) - [What Does isinstance() Do in Python?](https://realpython.com/what-does-isinstance-do-in-python/) - [Python Glossary](https://realpython.com/ref/glossary/) +- [Defining Your Own Python Function](https://realpython.com/defining-your-own-python-function/) +- [What Does -> Mean in Python Function Definitions?](https://realpython.com/what-does-arrow-mean-in-python/) +- [How Do You Choose Python Function Names?](https://realpython.com/python-function-names/) +- [Using Python Optional Arguments When Defining Functions](https://realpython.com/python-optional-arguments/) + +- [Python Classes: The Power of Object-Oriented Programming](https://realpython.com/python-classes/) +- [Python Class Constructors: Control Your Object Instantiation](https://realpython.com/python-class-constructor/) +- [Python Metaclasses](https://realpython.com/python-metaclasses/) +- [What Is Python's __init__.py For?](https://realpython.com/python-init-py/) +- [Python's property(): Add Managed Attributes to Your Classes](https://realpython.com/python-property/) + +- [How to Run Your Python Scripts and Code](https://realpython.com/run-python-scripts/) +- [How Can You Structure Your Python Script?](https://realpython.com/python-script-structure/) + +- [How to Use Generators and yield in Python](https://realpython.com/introduction-to-python-generators/) + ## Mathspp > Website: https://mathspp.com diff --git a/examples/001_decorators_part1.py b/python-examples/001_decorators_part1.py similarity index 100% rename from examples/001_decorators_part1.py rename to python-examples/001_decorators_part1.py diff --git a/examples/001_list.py b/python-examples/001_list.py similarity index 100% rename from examples/001_list.py rename to python-examples/001_list.py diff --git a/examples/001_table_output.py b/python-examples/001_table_output.py similarity index 100% rename from examples/001_table_output.py rename to python-examples/001_table_output.py diff --git a/examples/002_decorators_part2.py b/python-examples/002_decorators_part2.py similarity index 100% rename from examples/002_decorators_part2.py rename to python-examples/002_decorators_part2.py diff --git a/examples/003_decorators_part2.py b/python-examples/003_decorators_part2.py similarity index 100% rename from examples/003_decorators_part2.py rename to python-examples/003_decorators_part2.py diff --git a/examples/004_decorators_part2.py b/python-examples/004_decorators_part2.py similarity index 100% rename from examples/004_decorators_part2.py rename to python-examples/004_decorators_part2.py diff --git a/examples/README.md b/python-examples/README.md similarity index 100% rename from examples/README.md rename to python-examples/README.md diff --git a/examples/date.py b/python-examples/date.py similarity index 100% rename from examples/date.py rename to python-examples/date.py diff --git a/python-builds/README.md b/python/builds/README.md similarity index 100% rename from python-builds/README.md rename to python/builds/README.md diff --git a/python-cpython/README.md b/python/cpython/README.md similarity index 100% rename from python-cpython/README.md rename to python/cpython/README.md diff --git a/python-data-structure/README.md b/python/data-structure/README.md similarity index 100% rename from python-data-structure/README.md rename to python/data-structure/README.md diff --git a/python-functions/README.md b/python/functions/README.md similarity index 100% rename from python-functions/README.md rename to python/functions/README.md diff --git a/python-gui/README.md b/python/gui/README.md similarity index 100% rename from python-gui/README.md rename to python/gui/README.md diff --git a/python-OOP/README.md b/python/oop/README.md similarity index 97% rename from python-OOP/README.md rename to python/oop/README.md index bd28803..5acfe51 100644 --- a/python-OOP/README.md +++ b/python/oop/README.md @@ -37,4 +37,4 @@ #### Year 7: [Class Methods, Static Methods, and Class Attributes](https://thepythoncodingstack.substack.com/p/python-oop-special-methods-6) -:arrow_right: [The Python Coding Stack](https://thepythoncodingstack.substack.com/p/a-magical-tour-through-object-oriented) \ No newline at end of file +:arrow_right: [The Python Coding Stack](https://thepythoncodingstack.substack.com/p/a-magical-tour-through-object-oriented) diff --git a/python-packaging/README.md b/python/packaging/README.md similarity index 100% rename from python-packaging/README.md rename to python/packaging/README.md diff --git a/python-packaging/tools/packaged.md b/python/packaging/tools/packaged.md similarity index 100% rename from python-packaging/tools/packaged.md rename to python/packaging/tools/packaged.md diff --git a/python-packaging/tools/pdm.md b/python/packaging/tools/pdm.md similarity index 100% rename from python-packaging/tools/pdm.md rename to python/packaging/tools/pdm.md diff --git a/python-packaging/tools/poetry.md b/python/packaging/tools/poetry.md similarity index 100% rename from python-packaging/tools/poetry.md rename to python/packaging/tools/poetry.md diff --git a/python-packaging/tools/rye.md b/python/packaging/tools/rye.md similarity index 100% rename from python-packaging/tools/rye.md rename to python/packaging/tools/rye.md diff --git a/python-packaging/tools/uv/README.md b/python/packaging/tools/uv/README.md similarity index 99% rename from python-packaging/tools/uv/README.md rename to python/packaging/tools/uv/README.md index f0e0384..43a43b9 100644 --- a/python-packaging/tools/uv/README.md +++ b/python/packaging/tools/uv/README.md @@ -41,6 +41,11 @@ Update `uv` to the latest version: uv self update ``` +Get `uv` version: +```shell +uv self version +``` + ### Python Install a specific Python version: diff --git a/python-packaging/tools/uv/uv-script.md b/python/packaging/tools/uv/uv-script.md similarity index 100% rename from python-packaging/tools/uv/uv-script.md rename to python/packaging/tools/uv/uv-script.md diff --git a/python-packaging/tools/yen.md b/python/packaging/tools/yen.md similarity index 100% rename from python-packaging/tools/yen.md rename to python/packaging/tools/yen.md diff --git a/python-patterns/README.md b/python/patterns/README.md similarity index 100% rename from python-patterns/README.md rename to python/patterns/README.md diff --git a/python-peps/README.md b/python/peps/README.md similarity index 100% rename from python-peps/README.md rename to python/peps/README.md diff --git a/python-pypi/README.md b/python/pypi/README.md similarity index 74% rename from python-pypi/README.md rename to python/pypi/README.md index 2f8be64..9dd58f4 100644 --- a/python-pypi/README.md +++ b/python/pypi/README.md @@ -9,3 +9,9 @@ - [Publishing to PyPI with a Trusted Publisher](https://docs.pypi.org/trusted-publishers/) - [Attestations: A new generation of signatures on PyPI](https://blog.trailofbits.com/2024/11/14/attestations-a-new-generation-of-signatures-on-pypi/) + +## PyPI API + +```shell +curl -s "https://pypi.org/simple//?format=application/vnd.pypi.simple.v1+json" | jq +``` diff --git a/python-testing/README.md b/python/test/README.md similarity index 100% rename from python-testing/README.md rename to python/test/README.md diff --git a/python-tui/README.md b/python/tui/README.md similarity index 100% rename from python-tui/README.md rename to python/tui/README.md diff --git a/python-typing/README.md b/python/typing/README.md similarity index 100% rename from python-typing/README.md rename to python/typing/README.md diff --git a/python-virtualenvs/README.md b/python/virtualenvs/README.md similarity index 100% rename from python-virtualenvs/README.md rename to python/virtualenvs/README.md diff --git a/python-virtualenvs/python-virtualenv.md b/python/virtualenvs/python-virtualenv.md similarity index 97% rename from python-virtualenvs/python-virtualenv.md rename to python/virtualenvs/python-virtualenv.md index 7765186..5c5a4be 100644 --- a/python-virtualenvs/python-virtualenv.md +++ b/python/virtualenvs/python-virtualenv.md @@ -93,4 +93,4 @@ wheel 0.34.2 You can see the difference of your packages list Python installed on virtualenv with packages Python installed in your system. -Source: [python.org](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) \ No newline at end of file +Source: [python.org](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) diff --git a/python-web/README.md b/python/web/README.md similarity index 100% rename from python-web/README.md rename to python/web/README.md