pylicensing
Pylicensing is a leightweight tool designed to make key authentication and creation on your distributed python programs easier. It connects to a mongodb database. Click this link to learn more about mongodb, a nosql easy-to-use database with a free tier.
How to install
Pylicensing can be installed via pypi
pip install pylicensing
Warning
I do not recommend to connect to the database on the client directly. If your program was to be cracked, you would expose a database connection string to a possibly malicious person. Be precautious and introduce an API between your client and the database. Pylicensing provides the methods your API client needs.
You can still use pylicensing on your user client, as you could for example check that the Key your user entered conforms the KeyFormat you used for your application, this would prevent people from spamming meaningless keys.
Features
- Customize the Format of a
Key, i.e allow sets of characters, customize amount of sections... Keymetadata (creation date, expiration date, owner, hwids..)- HWID limitations and registrations (max hwids, registered hwids...)
- Key format validations, to avoid requesting a database query.
- Easy database management and queries
Example
You can also check the examples folder in the repository for more detailed examples.
Creating a Key object
my_key_format = KeyFormat(
sections=5, chars_per_section=5, seperator="-", numeric_characters=True
)
new_user_key = Key.create(
my_key_format, user="Freddie Faulig", hwid_limit=1, valid_for=timedelta(days=30)
)
Establishing your database connection
client: MongoClient = MongoClient(os.environ.get("DATABASE_CONNECTION"))
key_manager = KeyManager(client.test.example)
Adding a key to the database
new_user_key = Key.create(
my_key_format, user="Freddie Faulig", hwid_limit=1, valid_for=timedelta(days=30)
)
key_manager = KeyManager(client.test.example)
key_manager.add_to_collection(new_user_key)
Metadata
Release files for pylicensing 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pylicensing-0.0.3.tar.gz | 11.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylicensing-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / pylicensing-0.0.3.tar.gz
| Download URL | pylicensing-0.0.3.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
636e69db9e5636d8971a8b05851fc1fdf44b0d9817005466acee230e119f05c3
|
|
BLAKE2b-256 checksum How to use checksums |
d07fd6dc81223b18c101e2c00cbd15cc916049e71b1cb1a2aeb704f65230da99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|
Release files / pylicensing-0.0.3-py3-none-any.whl
| Download URL | pylicensing-0.0.3-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d9c14c8ab0833a02ca785a4562379cdeaf85e8e42bfa5e7c15e8289ebb07c4a
|
|
BLAKE2b-256 checksum How to use checksums |
27e114ef10d7adc00526f89110ea14eb2b4f38721a29d601510792e57bc0e600
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.2
|