getinstance
Project description
Installation
pip install getinstance
Usage
from getinstance import InstanceManager
class Country:
instances = InstanceManager()
def __init__(self, name):
self.name = name
def hello(self, username):
print(f'hello, {username} from {self.name}')
au = Country('Australia')
ru = Country('Russia')
print(list(Country.instances.all()))
print(Country.instances.get(name='Australia'))
Country.instances.filter(name='Russia').hello(username='Alice')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
getinstance-0.5.tar.gz
(1.6 kB
view details)
Built Distribution
File details
Details for the file getinstance-0.5.tar.gz
.
File metadata
- Download URL: getinstance-0.5.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.20.1 CPython/3.11.10 Linux/6.11.6-2-default
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 950c8156f74035a14cb8f8e522b4ab84046e535e067aa55c5ee5b440abbd0fdf |
|
MD5 | 2be235e9a4e1db7eca2b1da23260d085 |
|
BLAKE2b-256 | d42ed93c4d0fced5a4d538b699defb230aaec08c42dc6c6570097a89c5e0a7b6 |
File details
Details for the file getinstance-0.5-py3-none-any.whl
.
File metadata
- Download URL: getinstance-0.5-py3-none-any.whl
- Upload date:
- Size: 1.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.20.1 CPython/3.11.10 Linux/6.11.6-2-default
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bb5000193680093fb23e71a3ad58e76552ac3644572c1bb912c30f11a298ebd |
|
MD5 | c210905334119e27ad21fc072290aca1 |
|
BLAKE2b-256 | 87e718c3d24682414b3918853aac213e55968b9d9bab03dc5e72be06ee89a07c |