https://github.com/JacobCoffee/niapi
Toy project to showcase Litestar, HTMX, TailwindCSS. Network Information API
https://github.com/JacobCoffee/niapi
api htmx litestar network python tailwindcss
Last synced: 5 months ago
JSON representation
Toy project to showcase Litestar, HTMX, TailwindCSS. Network Information API
- Host: GitHub
- URL: https://github.com/JacobCoffee/niapi
- Owner: JacobCoffee
- License: mit
- Created: 2023-06-25T06:49:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-28T04:03:13.000Z (12 months ago)
- Last Synced: 2024-11-10T01:51:29.588Z (5 months ago)
- Topics: api, htmx, litestar, network, python, tailwindcss
- Language: Python
- Homepage: https://niapi.app/
- Size: 1.44 MB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.rst
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-litestar - Network Information API - Toy app with TailwindCSS and HTMX. (Third-Party Extensions / Projects)
README
![]()
![]()
| Project | | Status |
|-----------|:----|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| CI/CD | | [](https://github.com/JacobCoffee/niapi/actions/workflows/publish.yaml) [](https://github.com/JacobCoffee/niapi/actions/workflows/ci.yaml) [](https://github.com/JacobCoffee/niapi/actions/workflows/docs.yaml) [](https://github.com/JacobCoffee/niapi/actions/workflows/github-code-scanning/codeql) |
| Package | | [](https://badge.fury.io/py/niapi)  |
| Quality | | [](https://codecov.io/gh/JacobCoffee/niapi) [](https://sonarcloud.io/summary/new_code?id=JacobCoffee_niapi) [](https://sonarcloud.io/summary/new_code?id=JacobCoffee_niapi) [](https://sonarcloud.io/summary/new_code?id=JacobCoffee_niapi) [](https://sonarcloud.io/summary/new_code?id=JacobCoffee_niapi) [](https://sonarcloud.io/summary/new_code?id=JacobCoffee_niapi) [](https://snyk.io/test/github/JacobCoffee/niapi) |
| Community | | [](https://twitter.com/_scriptr) |
| Meta | | [](https://github.com/JacobCoffee/niapi) [](https://github.com/astral-sh/ruff) [](https://github.com/psf/black) [](https://github.com/python/mypy) [](https://spdx.org/licenses/) [](https://github.com/sponsors/JacobCoffee) |[](https://sonarcloud.io/summary/new_code?id=JacobCoffee_niapi)
# `niapi` - Network Information API
[//]: # "TODO"
## Table of Contents
- [About](#about)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [Contributors](#contributors)
- [License](#license)
- [Acknowledgements](#acknowledgements)
- [Screenshots](#screenshots)## About
[//]: # "TODO"
## Installation
```console
pip install niapi
```## Usage
[//]: # "TODO"
Install the project:
```console
pip install -e .
```Run the project:
> **NOTE:** From within the virtual environment
```console
app run -r --debug
```Using the CLI:
```console
# via curl
➜ curl --request GET \
--url 'http://0.0.0.0:8000/calculator/ip?ip=4.8.15.16&prefix=23' \
--header 'Content-Type: application/json'
# via App CLI
# TODO
app calculate "10.248.15.39/29"
```Using the API
1. Browse to:
- [Swagger Web](https://niapi.app/api/swagger#/) or [Swagger Localhost](http://127.0.0.1:8000/api/swagger#/)
- [Elements](https://niapi.app/api/elements/) or [Elements Localhost](http://127.0.0.1:8000/api/elements/)
2. Use the auto-generated API docs to interact with the APIFrom around the web:
Browse to https://niapi.app/ and use the front page form, API, or `curl` to interact with the API.
## Contributing
See [CONTRIBUTING.rst](CONTRIBUTING.rst) for more information.
Start the app:
```console
app run-all
```Start the TailwindCSS watcher:
```console
tailwindcss -i niapi/domain/web/resources/input.css -o niapi/domain/web/resources/style.css --watch
```## Contributors
[//]: # "TODO"
## License
[MIT](LICENSE)
## Acknowledgements
- Built on Litestar and Pydantic
- Using https://feathericons.dev/
- Using TailwindCSS## Screenshots
[//]: # "TODO"
  