memberjojo - tools for working with members.
Project description
memberjojo
memberjojo is a Python library for using Membermojo
data from CSV imports.
It provides member database, and completed payments querying.
This is done in a local SQLite database which is optionally encrypted if sqlcipher3
is installed, and does not alter anything on Membermojo.
It provides tools to load, and query membership and transaction data efficiently
without having to use SQLite directly.
When importing CSV files existing entries are dropped before import, so you can
just import the latest download and the local database is updated with a summary
diff printed out.
Using the download_csv function the csv can be downloaded directly into the db, which can also be in memory if :memory: is used as the db path.
Installation
Installing via pip on macos with optional sqlcipher installed via homebrew:
(The sqlcipher bindings are compiled by pip so the C_INCLUDE_PATH and
LIBRARY_PATH are needed for the libsqlcipher files to be found)
brew install sqlcipher
export C_INCLUDE_PATH="/opt/homebrew/opt/sqlcipher/include"
export LIBRARY_PATH="/opt/homebrew/opt/sqlcipher/lib"
pip install memberjojo[sqlciper]
Installing via pip on ubuntu:
sudo apt-get --no-install-recommends --no-install-suggests install libsqlcipher-dev
pip install memberjojo[sqlcipher]
Installing via pip without sqlcipher:
pip install memberjojo
Or clone the repo and install locally with flit:
git clone https://github.com/a16bitsysop/memberjojo.git
cd memberjojo
flit install --symlink
Usage
Example loading members and using Member objects:
from pathlib import Path
from membermojo import Member
# database is created if it does not exist
member_database_path = Path(Path(__file__).parent, "database", "my-members.db")
member_csv_path = Path("download", "members.csv")
members = Member(member_database_path, "My DB Password")
members.import_csv(member_csv_path)
for member in members:
print(member.first_name, member.last_name, member.member_number)
# Get full name for a given member number
found_name = members.get_name(1)
if found_name:
print(f"Member with id of 1 is {found_name}")
else:
print("Member 1 does not exist")
Documentation
Full documentation is available at
👉 https://a16bitsysop.github.io/memberjojo/
Running Tests
Run tests:
pytest
Contributing
Contributions are welcome! Please:
- Fork the repo
- Create your feature branch
git checkout -b my-feature - Edit the source code to add and test your changes
- Commit your changes
git commit -m 'Add some feature' - Push to your branch
git push origin my-feature - Open a Pull Request
Please follow the existing code style and write tests for new features.
License
This project is licensed under the MIT MIT License.
Contact
Created and maintained by Duncan Bellamy. Feel free to open issues or reach out on GitHub.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memberjojo-3.0.tar.gz.
File metadata
- Download URL: memberjojo-3.0.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c77e51df235e9966eda74706e98561ba7ec7d32260245531ab8409e574d152f7
|
|
| MD5 |
118f7e05a22540130a6b67b5e8c8038d
|
|
| BLAKE2b-256 |
7fea5c14e0ccdb77c327cc042ad2230fb151cb79a3cdfcc2805103839adf6605
|
Provenance
The following attestation bundles were made for memberjojo-3.0.tar.gz:
Publisher:
publish.yaml on a16bitsysop/memberjojo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memberjojo-3.0.tar.gz -
Subject digest:
c77e51df235e9966eda74706e98561ba7ec7d32260245531ab8409e574d152f7 - Sigstore transparency entry: 907889204
- Sigstore integration time:
-
Permalink:
a16bitsysop/memberjojo@594a2047377e2283452bfaf917411186a0256804 -
Branch / Tag:
refs/tags/v3.0 - Owner: https://github.com/a16bitsysop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@594a2047377e2283452bfaf917411186a0256804 -
Trigger Event:
push
-
Statement type:
File details
Details for the file memberjojo-3.0-py3-none-any.whl.
File metadata
- Download URL: memberjojo-3.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5f0563411ff7689400259af69bd36722f394b9f89080f40143ecec468674480
|
|
| MD5 |
eecd0ada91b1502333fe0491152790a5
|
|
| BLAKE2b-256 |
36f69f978312437bf96d982f06fde60a3f826726164a9d29f9d913ecabc41acd
|
Provenance
The following attestation bundles were made for memberjojo-3.0-py3-none-any.whl:
Publisher:
publish.yaml on a16bitsysop/memberjojo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memberjojo-3.0-py3-none-any.whl -
Subject digest:
e5f0563411ff7689400259af69bd36722f394b9f89080f40143ecec468674480 - Sigstore transparency entry: 907889211
- Sigstore integration time:
-
Permalink:
a16bitsysop/memberjojo@594a2047377e2283452bfaf917411186a0256804 -
Branch / Tag:
refs/tags/v3.0 - Owner: https://github.com/a16bitsysop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@594a2047377e2283452bfaf917411186a0256804 -
Trigger Event:
push
-
Statement type: