Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Detailed documentation of module can by found here:

## License

Randname is licensed under the terms of the [MIT license](license.md)
Randname is licensed under the terms of the [MIT license](LICENSE)
36 changes: 18 additions & 18 deletions docs/contribution.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to randname

In order to make contributing to this project as easy and transparent as possible,
In order to make contributing to this project as easy and transparent as possible,
whether it's:

- Reporting a bug
Expand All @@ -11,15 +11,15 @@ whether it's:

## We Develop with Github

We use github to host code, to track issues and feature requests, as well as
We use github to host code, to track issues and feature requests, as well as
accept pull requests.

## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html)

So All Code Changes Happen Through Pull Requests

Pull requests are the best way to propose changes to the codebase
(we use [Github Flow](https://guides.github.com/introduction/flow/index.html)).
Pull requests are the best way to propose changes to the codebase
(we use [Github Flow](https://guides.github.com/introduction/flow/index.html)).
We actively welcome your pull requests:

1. Fork the repo and create your branch from `master`.
Expand All @@ -31,35 +31,35 @@ We actively welcome your pull requests:

## Any contributions you make will be under the MIT Software License

In short, when you submit code changes, your submissions are understood to be
under the same [MIT License](http://choosealicense.com/licenses/mit/) that
In short, when you submit code changes, your submissions are understood to be
under the same [MIT License](http://choosealicense.com/licenses/mit/) that
covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](https://github.com/briandk/transcriptase-atom/issues)

We use GitHub issues to track public bugs. Report a bug by
[opening a new issue](https://github.com/ajwalkiewicz/randname/issues);
We use GitHub issues to track public bugs. Report a bug by
[opening a new issue](https://github.com/ajwalkiewicz/randname/issues);
it's that easy!

## Write bug reports with detail, background, and sample code

[This is an example](http://stackoverflow.com/q/12488905/180626) of a bug
report I wrote, and I think it's not a bad model. Here's
[another example from Craig Hockenberry](http://www.openradar.me/11905408),
[This is an example](http://stackoverflow.com/q/12488905/180626) of a bug
report I wrote, and I think it's not a bad model. Here's
[another example from Craig Hockenberry](http://www.openradar.me/11905408),
an app developer whom I greatly respect.

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
[My stackoverflow question](http://stackoverflow.com/q/12488905/180626)
includes sample code that *anyone* with a base pytohn setup can run to
- Give sample code if you can.
[My stackoverflow question](http://stackoverflow.com/q/12488905/180626)
includes sample code that *anyone* with a base pytohn setup can run to
reproduce what I was seeing
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff
- Notes (possibly including why you think this might be happening, or stuff
you tried that didn't work)

People *love* thorough bug reports. I'm not even kidding.
Expand All @@ -73,15 +73,15 @@ When writing code please follow below PEP's:

## Creating database

Please follow instructions from [database guide](database.md) when creating
Please follow instructions from [database guide](database.md) when creating
new database.

## License

By contributing, you agree that your contributions will be licensed under its
By contributing, you agree that your contributions will be licensed under its
MIT License.

## References

This document was adapted from the open-source contribution guidelines for
This document was adapted from the open-source contribution guidelines for
[Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
30 changes: 15 additions & 15 deletions docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

## Legal warning

Please kep in mind that randname is an open source project and we relay only
Please kep in mind that randname is an open source project and we relay only
on legally possessed data.

## How database looks

All data files are stored in `data` directory.

`data` directory contains directories for every currently supported country.
Country directories are named accordingly to [Aplha-2 code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements).
`data` directory contains directories for every currently supported country.
Country directories are named accordingly to [Aplha-2 code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements).
It means that directory name is exactly 2 capital letters.

Inside country directory there are 2 separate directories and 1 info.json file.
Inside country directory there are 2 separate directories and 1 info.json file.
One for first names and one for las names.

* `first_names`
* `last_names`

Expand All @@ -35,16 +35,16 @@ Above `info.json` file contain following information:

Inside names directories, are actual data files.

Data files are in [JSON](https://en.wikipedia.org/wiki/JSON) format,
Data files are in [JSON](https://en.wikipedia.org/wiki/JSON) format,
but without `.json` extension.

Data files has to starts from `year`, `underscore`, and `gender capital letter`
Data files has to starts from `year`, `underscore`, and `gender capital letter`
- `M`, `F` or `N`. Example: `1990_M` for male names in 1990.

### What letter to use?

Not all languages have same names grammar. For example english language have
same form of last name regardless the gender. In the other hand some languages
Not all languages have same names grammar. For example english language have
same form of last name regardless the gender. In the other hand some languages
like polish have separate last names forms for male and female.

Use:
Expand Down Expand Up @@ -93,19 +93,19 @@ randname/data/

Most of the databases with names are in `.csv` or `.xlsx` formats.

When contributing pleas send also a source file from which you are creating
When contributing pleas send also a source file from which you are creating
JSON data.

## Tools

In `/tools` you can find simple python scrip that can help you to create JSON
In `/tools` you can find simple python scrip that can help you to create JSON
files from `.xlsx` or `.csv` files.

In order to make it work out of the box, a source file has to have the following
In order to make it work out of the box, a source file has to have the following
structure:
* contains 2 columns
* first column has to be with names
* second column has to be with integer numbers that indicates the number name
* second column has to be with integer numbers that indicates the number name
occurrences.

### Example source file
Expand All @@ -117,7 +117,7 @@ occurrences.
| WIŚNIEWSKI | 72658 |
| WÓJCIK | 65836 |
| KOWALCZYK | 64736 |
|<- snip -> | |
|<- snip -> | |
| ŽUK-OLSZEWSKI | 2 |
| ŽUKOVSKI | 2 |
| ŽUKOVSKIJ | 2 |
Expand All @@ -132,7 +132,7 @@ python3 convert_to_json.py -t csv -f PL/first_names/Imiona_nadane_wPolsce_w_lata

## Sources

US
US

Last names

Expand Down
16 changes: 8 additions & 8 deletions docs/environment.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Setting Up the Development Environment

To contribute to the cochar project, it's important to set up a development
environment that matches the project's requirements. This ensures consistency
To contribute to the cochar project, it's important to set up a development
environment that matches the project's requirements. This ensures consistency
and reduces the time spent debugging non-existent bugs.

## Prerequisites

Before setting up the environment, ensure you have the following installed:

- **Python**: The project is built using Python. Make sure you have Python
- **Python**: The project is built using Python. Make sure you have Python
installed on your machine. The project has to be compatible with **python3.12**
- **Make**: We use Make to simplify various tasks such as setup, testing,
- **Make**: We use Make to simplify various tasks such as setup, testing,
and building the project.
- **Curl**: Required for downloading scripts.
- **Linux** machine: It is not a hard requirement, but all instructions here
- **Linux** machine: It is not a hard requirement, but all instructions here
are based on **Ubuntu 22.04**.

## Steps to Set Up the Environment
Expand Down Expand Up @@ -84,13 +84,13 @@ Before setting up the environment, ensure you have the following installed:
make docs_upload
```

By following these steps, you will have a development environment that is
consistent with the project's requirements. For any issues or further details,
By following these steps, you will have a development environment that is
consistent with the project's requirements. For any issues or further details,
refer to the [Contribution Guidelines](contribution.md).

## References

* Python: https://www.python.org/
* Python: https://www.python.org/
* Project management tool: [UV](https://docs.astral.sh/uv/)
* Formatter: [Ruff](https://docs.astral.sh/ruff/)
* Testing: [Pytest](https://docs.pytest.org/en/stable/index.html)
49 changes: 26 additions & 23 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ Python module to generate random name.

## Summary

Randname is a python module for generating random name - first and last.
Randname is a python module for generating random name - first and last.
It uses official data from appropriate governmental/scientific research centers.

Names are drawn with the consideration of their frequency. Therefor most common
Names are drawn with the consideration of their frequency. Therefor most common
name wil be drawn much more often (this feature can be disabled).

Currently supported countries:
US, PL, ES.

Default database is small, and constrained to 10000 records for each first and
Default database is small, and constrained to 10000 records for each first and
last names for every country. Default data size: 60 000 records

With the full database downloaded from project
[github page](https://github.com/ajwalkiewicz/randname/),
With the full database downloaded from project
[github page](https://github.com/ajwalkiewicz/randname/),
the amount of names is increased to around 700 000 records.

## Installation
Expand All @@ -34,8 +34,22 @@ Randname is available in python repository, and can be downloaded with pip.
pip3 install rname
```

Yes, use `rname` to install the package.

## Usage

!!! warning
Because `randname` package on PyPi was already taken, it was named `rname`
That's why to install in you need to refer to `rname`:
```bash
pip3 install rname
```
But package installs itself as `randname`. And you should import is by
referring to `randname`:
```python
import randname
```

```Python
>>> import randname

Expand All @@ -57,9 +71,9 @@ pip3 install rname

## Database

Default database included in pypi package is very small. To not make the
package unnecessary too large, every country have one set of data for last
and first names (with distinction for the male, female, neutral name),
Default database included in pypi package is very small. To not make the
package unnecessary too large, every country have one set of data for last
and first names (with distinction for the male, female, neutral name),
for the most recent year. Each file contains up to 10000 records.

Currently supported countries:
Expand All @@ -81,7 +95,7 @@ ES:

### Biger database

Full database is bigger and doesn't have the limit of records. If you wan to
Full database is bigger and doesn't have the limit of records. If you wan to
use it, download it from project [github page](https://github.com/ajwalkiewicz/randname/).

To use other databases specify directory by setting `database_path` variable
Expand All @@ -97,11 +111,11 @@ More details about database can be found [here](database.md)

## Contribution

If you want to contribute to randname project read
If you want to contribute to randname project read
[contribution](contribution.md) for more information.

I am looking especially for help with database creation. More information on
how to help/create appropriate data files with names can be found in
I am looking especially for help with database creation. More information on
how to help/create appropriate data files with names can be found in
[database guide](database.md)

## Authors & Contributors
Expand All @@ -110,17 +124,6 @@ how to help/create appropriate data files with names can be found in

**Contributors**: Be first!

## To do

1. [x] Summary
1. [ ] Tools
1. [ ] Contribution guideline
1. [ ] Unit tests
1. [ ] Instruction for database creation
1. [x] Add equal chances for every name
1. [ ] Support for other countries names
1. [ ] Add 9 more countries

## License

Randname is licensed under the terms of the [MIT license](license.md)
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ plugins:
group_by_category: true
show_submodules: true


markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- admonition
- pymdownx.details
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rname"
version = "1.0.0-beta.1"
version = "1.0.0-beta.2"
description = "Get random first/last name"
readme = "README.md"
authors = [
Expand Down
Loading