Skip to main content

amazedb

Tests Upload Python Package Version License

It is a file based NoSQL database management system written in python.

All the databases are stored in the db sub-directory of the current directory. This behaviour can be manipulated as we'll see later on.

How to use

You can install amazedb through pip.

$ python -m pip install amazedb

Example usage

from amazedb import dbms

# Open a database
mydb = dbms.db("mydatabase")

# Create a group inside it
users = mydb.createGroup("users")

# Or access it via
users = mydb.getGroup("users")

# Add some data to our users
users.insert({
    "name": "Jalaj",
    "role": "admin",
    "email": "example@example.org",
    "age": 17
})

# Or add multiple documents simultaneously
users.insert_many(
    {"name": "ABCD", "age": 10},
    {"name": "EFGH", "age": 20},
    {"name": "IJKL", "age": 30}
)

# Get the user with the name ABCD
abcd = user.get_one({"name": "ABCD"})

# Or use some advanced search filters
abcd = users.get_one({
    "name": {"__re" : ".*A.*"} # All users with A in their name,
    "age": {"__gt": 10} # All users with age more than 10
})

# Or get them sorted
# Get all users sorted by age
abcd = users.get({}, sortby="age")

# Update some values
updated = users.update({
    "name" : "ABCD"         # Find the user with the name ABCD
}, {
    "email" : "abcd@example.org" # And update its email field
})

# Use advanced search in update function
updated = users.update({
    # All users with age greater than or equal to 10
    "age": {"__gte" : 10}
}, {
    "age": 5
})

# Update the firs occurence of search filter
update_one = users.update_one({

    # You can also use custom functions for search
    "name": { "__cf": lambda val: True if len(val) > 10 else False}
}, {
    "name": "newName"
})

# Delete some documents
delete = users.remove({
    "name": "ABCD"
})

# Delete only one document
del_one = users.remove_one({
    "name": "EFGH"
})

# Delete the group
users.drop()

# Delete the database
mydb.drop()

For detailed usage instructions, refer to USAGE.md

Contributing

Contributions to our project through new issues and pull requests are always welcome. We would love to see other people contribute to the project and make it better.

Although, before you contribute, you should follow our issue templates. Any PR or issue not following one of the templates will be ignored and closed immediately. And yes, before opening a issue and don't forget to follow the code of conduct

License

This project is licensed under MIT.

Metadata

Release files for amazedb 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amazedb 1.1.0
File Size Uploaded
amazedb-1.1.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amazedb 1.1.0
File Interpreter ABI Platform
amazedb-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / amazedb-1.1.0.tar.gz

Download URL amazedb-1.1.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6cdf60ae9d14976eeddd18fa0e4cff8f9eca711c74c94684da410d6dabb6c2ba
BLAKE2b-256 checksum
How to use checksums
189a3b3aafb89380d20ef847be019ce42b7a0d40c4284c13971a0032c743e1fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / amazedb-1.1.0-py3-none-any.whl

Download URL amazedb-1.1.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1f030d9c291372c761281b9f5ada3c470bd20022d0a7f205ba3cb3f975a2fe9
BLAKE2b-256 checksum
How to use checksums
2494efeb82146cf841fac8ed157591201097884eb4244d78618079ab97734d82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page