Skip to main content

REST API Client designed for microservices

Project description

Documentation Continuous Integration Coverage Report Maintainability

Blacksmith is a library to build a solid microservices architecture based on REST API.

Todays, developers have lots of choices to create microservices, plenty of framework are available, but when it comes to consume them, there is a lack of clients.

Consuming an API is not just about doing HTTP requests, it has to be designed for failure, monitoring, and service discovery with an elegant abstraction. blacksmith aims to provide a solution for developers to write clean client code and for ops to monitor api calls also on the client side.

What is Blacksmith

Blacksmith is a declarative tool for consuming REST Api.

In a REST API, resources are declared under HTTP routes, and every http verb has its own definition.

In Blacksmith, every resources are bound to schemas that define request and response, in order to abstract HTTP.

This is a common concept for SQL table with ORM, where tables are bound to models, and then, operations are available on models. This is a usefull abstraction to write maintainable code and to dive into a project easilly.

Handling API resources using an http client, such as requests does not handle that abstraction, and does not handle bindings to objects, and can be compared to a raw connection because it is just a transport.

This is the problem blacksmith is trying to solve, having a nice abstraction of services that use REST in a microservices architecture.

Why not using a SDK to consume APIs ?

SDK are about importing an external library in a service. And a service is consumed by many services for different purpose. As a result, SDK create coupling between service, and this is something that should be avoid.

An SDK for a service will declare all the resources, routes, and attribute of resources when a service consumer may consume just a few.

SDK may hide what is really used by every service.

To avoid this, every consumers of API, should declare its own consumers contracts to get a better view of which service use what.

Building SDK

By the way, blacksmith can be use to build a SDK for public API.

Working with or without asyncio

Blacksmith is written for asyncio, but works with synchronous API without overhead. The synchronous API is generated using unasync and tested.

Read More

You can read the full documentation of this library here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blacksmith-4.0.1.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

blacksmith-4.0.1-py3-none-any.whl (62.3 kB view details)

Uploaded Python 3

File details

Details for the file blacksmith-4.0.1.tar.gz.

File metadata

  • Download URL: blacksmith-4.0.1.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.20.1 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for blacksmith-4.0.1.tar.gz
Algorithm Hash digest
SHA256 1dbb21e6af6524f20dcaf94164ce7e8519e28923576f054995ab9d7bbefcf0f5
MD5 a0e1c5f860426b8e84ef1fcf8dad85a5
BLAKE2b-256 11ad0c85772c7ec247cdba1c0da250ac311515bb0c6c8513542d7d1c4afab015

See more details on using hashes here.

File details

Details for the file blacksmith-4.0.1-py3-none-any.whl.

File metadata

  • Download URL: blacksmith-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 62.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.20.1 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for blacksmith-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d7f7838eaa45d7b27c88dd661fd760259015c5b68a975b2bb40692ec1f9acd6
MD5 a15632400d084938fc8ae8cfc3b070f6
BLAKE2b-256 3ed42796e4db6050d4cc8ab0b22b94a9dab5742a4c4f3b2ec7f19ece081a08b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page