Sex Machine
This package uses the underlying data from the program “gender” by Jorg Michael (described here). Its use is pretty straightforward:
>>> import sexmachine.detector as gender >>> d = gender.Detector() >>> d.get_gender(u"Bob") u'male' >>> d.get_gender(u"Sally") u'female' >>> d.get_gender(u"Pauley") # should be androgynous u'andy'
The result will be one of andy (androgynous), male, female, mostly_male, or mostly_female. Any unknown names are considered andies. Moreover, you can set unknown value to whatever you want:
>>> d = gender.Detector(unknown_value=u"ferhat") >>> d.get_gender(u"Pauley") u'ferhat'
I18N is fully supported:
>>> d.get_gender(u"Álfrún") u'female'
Additionally, you can give preference to specific countries:
>>> d.get_gender(u"Jamie") u'mostly_female' >>> d.get_gender(u"Jamie", u'great_britain') u'mostly_male'
Additionally, you can create a detector that is not case sensitive (default is to be case sensitive):
>>> d = sexmachine.detector.Detector(case_sensitive=False) >>> d.get_gender(u"sally") u'female' >>> d.get_gender(u"Sally") u'female'
Try to avoid creating many Detectors, as each creation means reading the data file.
Licenses
The generator code is distributed under the GPLv3. The data file nam_dict.txt is released under the GNU Free Documentation License.
Metadata
Release files for SexMachine 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| SexMachine-0.1.0.tar.gz | 4.0 kB | Without provenance | Details |
Release files / SexMachine-0.1.0.tar.gz
| Download URL | SexMachine-0.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
801a16b850dd573f3aeeef905762821fb321769c5d32cac6ed6a920e309f02c0
|
|
BLAKE2b-256 checksum How to use checksums |
345e43c2706c1e58cfcec2c5fda606fe42b7b4ae6257a8e5601fe39a2db9076b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for SexMachine 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.