nexatestlib


Namenexatestlib JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryNexaTestLib
upload_time2024-01-05 03:41:00
maintainer
docs_urlNone
authorAlex
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Medium multiply
A small demo library for a Medium publication about publishing libraries.

## Installation
```bash
pip install projectname
```
if we upload the package to PyPI. Otherwise, we can install it from a local directory:
```bash
pip install -e .
```
The flag -e stands for editable, which means that if we make changes to the code, we don’t need to reinstall the package. This is for the dev process. For prod, we can just install the package without the -e flag.


## Essence
The current Python logic is still valid. To create a Python library, we need to be aware of some additional knowledge.

1. Create an empty file called `setup.py`. This is one of the most important files when creating a Python library! Additionally, we need `pyproject.toml` file to specify how we build the library. And we use the `build` library and `python -m build` to build the library.
2. Create an empty file called `README.md`. This is the place where you can write markdown to describe the contents of your library for other users.
3. Create a folder called `mypythonlib`, or whatever you want your Python library to be called when you pip install it. (The name should be unique on pip if you want to publish it later.) **How to check the uniqueness**? Just search for the name on pip. If it’s not there, you’re good to go.
4. Create an empty file inside mypythonlib that is called `__init__.py`. Basically, any folder that has an `__init__.py` file in it, will be included in the library when we build it. Most of the time, you can leave the `__init__.py` files empty. Upon import, the code within `__init__.py` gets executed, so it should contain only the minimal amount of code that is needed to be able to run your project. For now, we will leave them as is.
5. Create functional code in the folder where `__init__.py` is located. 
6. Finally, create a folder tests in your root folder. Inside, create an empty __init__.py file. Add some empty file as you want. If we wish to compile the code into a library, we have to make sure the code is robust. And the test is necessary. If you want to use the test, just install `pytest` and `pytest-runner`. Then, run `python setup.py pytest` to run the all the tests in the tests folder.

After build, I have a `dist` folder, and we have a package with `.whl` and `.tar.gz` files. We can install the package with `pip install mypythonlib-0.0.1-py3-none-any.whl` or `pip install mypythonlib-0.0.1.tar.gz`.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nexatestlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Alex",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c9/88/7b00a06865da8c70b8630cb4ac6dc78f14327247032f875c4032cadb56ad/nexatestlib-0.1.0.tar.gz",
    "platform": null,
    "description": "# Medium multiply\nA small demo library for a Medium publication about publishing libraries.\n\n## Installation\n```bash\npip install projectname\n```\nif we upload the package to PyPI. Otherwise, we can install it from a local directory:\n```bash\npip install -e .\n```\nThe flag -e stands for editable, which means that if we make changes to the code, we don\u2019t need to reinstall the package. This is for the dev process. For prod, we can just install the package without the -e flag.\n\n\n## Essence\nThe current Python logic is still valid. To create a Python library, we need to be aware of some additional knowledge.\n\n1. Create an empty file called `setup.py`. This is one of the most important files when creating a Python library! Additionally, we need `pyproject.toml` file to specify how we build the library. And we use the `build` library and `python -m build` to build the library.\n2. Create an empty file called `README.md`. This is the place where you can write markdown to describe the contents of your library for other users.\n3. Create a folder called `mypythonlib`, or whatever you want your Python library to be called when you pip install it. (The name should be unique on pip if you want to publish it later.) **How to check the uniqueness**? Just search for the name on pip. If it\u2019s not there, you\u2019re good to go.\n4. Create an empty file inside mypythonlib that is called `__init__.py`. Basically, any folder that has an `__init__.py` file in it, will be included in the library when we build it. Most of the time, you can leave the `__init__.py` files empty. Upon import, the code within `__init__.py` gets executed, so it should contain only the minimal amount of code that is needed to be able to run your project. For now, we will leave them as is.\n5. Create functional code in the folder where `__init__.py` is located. \n6. Finally, create a folder tests in your root folder. Inside, create an empty __init__.py file. Add some empty file as you want. If we wish to compile the code into a library, we have to make sure the code is robust. And the test is necessary. If you want to use the test, just install `pytest` and `pytest-runner`. Then, run `python setup.py pytest` to run the all the tests in the tests folder.\n\nAfter build, I have a `dist` folder, and we have a package with `.whl` and `.tar.gz` files. We can install the package with `pip install mypythonlib-0.0.1-py3-none-any.whl` or `pip install mypythonlib-0.0.1.tar.gz`.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "NexaTestLib",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e941fe4df0272faa8ae2ebbaa2da5ee90eaaf116404512d1145908c207d3155",
                "md5": "c166c267db58a9eca977df07c4445a9a",
                "sha256": "7d364491612c06cd34377d687f8b6e923c7dbeccae122097c318c2bd22567628"
            },
            "downloads": -1,
            "filename": "nexatestlib-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c166c267db58a9eca977df07c4445a9a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 2717,
            "upload_time": "2024-01-05T03:40:58",
            "upload_time_iso_8601": "2024-01-05T03:40:58.769459Z",
            "url": "https://files.pythonhosted.org/packages/3e/94/1fe4df0272faa8ae2ebbaa2da5ee90eaaf116404512d1145908c207d3155/nexatestlib-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9887b00a06865da8c70b8630cb4ac6dc78f14327247032f875c4032cadb56ad",
                "md5": "479fdedf510798789dc173e1988c7340",
                "sha256": "69994b705fc98b536b4a56815dbe7bba7ca8dc71657378504ba2e353ed2597c3"
            },
            "downloads": -1,
            "filename": "nexatestlib-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "479fdedf510798789dc173e1988c7340",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2897,
            "upload_time": "2024-01-05T03:41:00",
            "upload_time_iso_8601": "2024-01-05T03:41:00.055582Z",
            "url": "https://files.pythonhosted.org/packages/c9/88/7b00a06865da8c70b8630cb4ac6dc78f14327247032f875c4032cadb56ad/nexatestlib-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-05 03:41:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nexatestlib"
}
        
Elapsed time: 0.18071s