Python Projects
- A python project can be used in two ways
- executable: This is your application
- cli
- desktop application
- When hosted on web:
- website
- web api
- library: These are reusable assets. Libraries are from three sources
- standard library: Available once we install python
- community library: Refer Here
- custom library: We creating a reusable
- executable: This is your application
Packages in python
- A package in python is a folder with a file
__init__.py. Name of the folder becomes package name - sub folders become sub packages.
- Refer Here and create a new package.
- For creating packages we have standard structures (not mandatory)
your_library/
├── LICENSE
├── README.md
├── pyproject.toml
├── setup.cfg
├── setup.py # (optional; if using setuptools)
├── MANIFEST.in # (optional; include non-code files)
├── requirements.txt # (optional; for dev dependencies)
│
├── src/
│ └── your_library/ # main package source code
│ ├── __init__.py
│ ├── core.py
│ ├── utils.py
│ └── ...
│
├── tests/ # unit and integration tests
│ ├── __init__.py
│ ├── test_core.py
│ └── test_utils.py
│
├── docs/ # documentation (optional)
│ ├── index.md
│ └── usage.md
│
├── examples/ # example scripts (optional)
│ └── demo_usage.py
│
└── scripts/ # CLI tools or helper scripts (optional)
└── cli_entry.py
Library Management System
-
Lets create a directory structure: Refer Here for the initial structure
-
objects:
- institution
- librarian
- faculty
- student
- book
- dvd
- magazine
- loan (transaction)
- policy
- charges
-
use-cases
- Refer Here for changes
