Skip to main content

A set of dataclasses concerning roles of persons and their particulars

Project description

deployment:
https://img.shields.io/pypi/v/personroles https://img.shields.io/pypi/pyversions/personroles.svg https://img.shields.io/pypi/implementation/personroles.svg
test/coverage:
https://app.codacy.com/project/badge/Grade/5a29d30f3ec7470cb17085a29a4c6a8f https://codecov.io/gh/0LL13/person/branch/master/graph/badge.svg https://api.codeclimate.com/v1/badges/714a256d1edf47898a22/maintainability https://coveralls.io/repos/github/0LL13/person/badge.svg?branch=master https://scrutinizer-ci.com/g/0LL13/person/badges/quality-score.png?s=0242cf58f51463f90ec17ee3d1708c07beaddd6624a07e9d228a2e337aa56388
build status:
https://travis-ci.org/0LL13/person.svg?branch=master https://pyup.io/repos/github/0LL13/person/shield.svg https://img.shields.io/github/issues-pr/0LL13/person https://img.shields.io/badge/security-bandit-yellow.svg
docs:
https://readthedocs.org/projects/person/badge/?version=latest https://img.shields.io/github/license/0LL13/person

A set of dataclasses concerning roles (academic, politician, …) of persons and their particulars

Features

Currently names of this structure are supported:

Names:                       first_name middle_name_1 middle_name_2 last_name/s
Names with academic title:   academic_title/s first_name ... last_name/s
Names with peer title:       peer_title/s first_name ... last_name/s
Names with peer preposition: first_name ... peer_preposition last_name/s
Names with all titles:       academic/peer_title first_name ... peer_preposition last_name/s

These roles have been sketched:

Academic - academic_title
Person - gender, born, age, deceased
Noble - peer_title, peer_preposition
Politician - minister, offices, party, parties
MoP - legislature, state, electoral_ward, ward_no, voter_count, parl_pres, parl_vicePres

Usage

from personroles import person

tom = person.Academic("Thomas H.", "Smith", academic_title="MBA")
print(tom)

Academic:
academic_title=MBA
first_name=Thomas
last_name=Smith
middle_name_1=H.
from personroles import mop_role

bob = mop_role.MoP("14", "NRW", "SPD", "Bob R.", "Smith", academic_title="Dr.", electoral_ward="Köln I")
print(bob)

MoP:
academic_title=Dr.
electoral_ward=Köln I
first_name=Bob
gender=male
last_name=Smith
legislature=14
membership={'14'}
middle_name_1=R.
parties=[Party(party_name='SPD', party_entry='unknown', party_exit='unknown')]
party_name=SPD
state=NRW
voter_count=121721
ward_no=13

Credits

This package was started with Cookiecutter and the audreyr/cookiecutter-pypackage project template. Also the project setup by Martin Heinz was very helpful. I felt the changes were necessary to keep the files containing the roles small.

Installation

pip install personroles

or

pipenv install personroles

Contribute

Please fork first and use for your own ends.
This package is structured like this:
personroles
├── mop_role.py
├── person.py
├── politician_role.py
├── your-contribution_role.py
├── resources
│   ├── constants.py
│   └── helpers.py
└── tests
    ├── test_mop.py
    ├── test_person.py
    ├── test_politician.py
    └── test_your-contribution.py

Because of its modular structure, all you need to do is add another role as “your-contribution_role.py”, and another test as “test_your-contribution.py”. Use current *_role modules as blueprint and delete if not needed.

Support

Fork and improve.

Planned

Fork and repeat with different roles.

Warranty

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

License

MIT License

Copyright (c) 2020 Oliver Stapel

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

personroles-0.1.8.tar.gz (125.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

personroles-0.1.8-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file personroles-0.1.8.tar.gz.

File metadata

  • Download URL: personroles-0.1.8.tar.gz
  • Upload date:
  • Size: 125.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for personroles-0.1.8.tar.gz
Algorithm Hash digest
SHA256 eb9fe42aa33ad57c9aa084501b411a4428ecacef823c099d94ad8c72babc3a61
MD5 d3f8a8d5e24cf0b26cca4fa567faaa72
BLAKE2b-256 b0cdd77f2703ab7a54a917104f7a65ac5547db4f1d1b7ce72125754f292f68fd

See more details on using hashes here.

File details

Details for the file personroles-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: personroles-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for personroles-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6fa94be097e3e3fb076e324f4cd1f0b1931cc4d761d5b2bfcd4e13b3264dd17b
MD5 e160bdff5fa57fc5bd049410764dc895
BLAKE2b-256 894422880215949d9fc2ae3bbf4436125a0c40f77b0a5c8ad8e92685c65b9316

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page