This is a simple FastAPI application for managing BACnet device IDs and network addresses. It provides CRUD (create, read, update, delete) endpoints for managing devices and network numbers.
The application uses SQLite for storing and managing the devices' IDs, network addresses, and network numbers.
- Python 3.7+
- FastAPI
- Uvicorn
- SQLite
- Clone the repository:
bashCopy code
git clone https://github.com/your-username/bacnet-device-manager.git
- Install the requirements:
cssCopy code
pip install fastapi uvicorn[standard] bac0
- Start the application:
cssCopy code
uvicorn main:app --reload
The application will be available at http://localhost:8000
.
The following endpoints are available:
POST /devices/
: Create a new device with the specified ID, network address, and network number.GET /devices/
: Get a list of all devices.GET /devices/{device_id}
: Get a device with the specified ID.PUT /devices/{device_id}
: Update the network address and network number of an existing device with the specified ID.DELETE /devices/{device_id}
: Delete an existing device with the specified ID.GET /networks/
: Get a list of all unique network numbers from the devices table.GET /networks/{network_number}
: Get a list of all devices on the specified network.
To use the endpoints, you can use a tool like curl
or httpie
, or use the interactive API documentation that is automatically generated by FastAPI at http://localhost:8000/docs
.
Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue or submit a pull request.