taxilang
datamodel-code-generator
taxilang | datamodel-code-generator | |
---|---|---|
3 | 9 | |
81 | 2,324 | |
- | - | |
9.3 | 9.4 | |
2 months ago | 5 days ago | |
Kotlin | Python | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
taxilang
-
Orbital – Dynamically unifying APIs and data with no glue code
Under the hood, the tags (and associated query language) are actually Taxi - an OSS meta-language and toolchain we build (and have shared previously).
-
Quickly modernizing SOAP APIs
Taxi is a relatively new entrant in the API space. It's goal is to let developers add simple, (but type-safe) tags into their APIs, so software can understand how different APIs relate to one another.
-
OpenAPI v4 Proposal
One of the gripes I have about OpenAPI is that it has a very low signal-to-noise ratio. It was bad in JSON, it's just as bad in YAML, with an added whitespace pedantry.
It's great to see a number of alternatives listed in this thread - there's much more active development in this space then I was aware of, and I hope that some of it gets upstreamed back into OpenAPI.
I'll shamelessly plug our tool in this space - Taxi (https://github.com/taxilang/taxilang), which has a dedicated DSL (not YAML) you can either use standalone, or embeddedd within OpenAPI.
I also happen to think that (for internal teams at least), generating clients on ${apiSpec} is a form of tight coupling, where producer and consumer become tied together. If you can avoid it, you should, as it allows producers and consumers to stay loosely coupled and evolve independetly without the gymnastics of avoiding breaking changes.
I've talked about this before, with proposed solutions.[0]
[0]https://orbitalhq.com/blog/2023-01-16-using-semantic-metadat...
datamodel-code-generator
- Datamodel-code-generator: Pydantic model/dataclass from OpenAPI, JSON, YAML
-
tRPC – Move Fast and Break Nothing. End-to-end typesafe APIs made easy
Like generating pydantic models or dataclasses for an OpenAPI schema? I haven't needed to go in that direction myself, but this[0] looks promising!
Apologies if I've misunderstood your comment
https://koxudaxi.github.io/datamodel-code-generator/
-
OpenAPI v4 Proposal
I'm sorry, but you have completely misunderstood the purpose of Open API.
It is not a specification to define your business logic classes and objects -- either client or server side. Its goal is to define the interface of an API, and to provide a single source of truth that requests and responses can be validated against. It contains everything you need to know to make requests to an API; code generation is nice to have (and I use it myself, but mainly on the server side, for routing and validation), but not something required or expected from OpenAPI
For what it's worth, my personal preferred workflow to build an API is as follows:
1. Build the OpenAPI spec first. A smaller spec could easily be done by hand, but I prefer using a design tool like Stoplight [0]; it has the best Web-based OpenAPI (and JSON Schema) editor I have encountered, and integrates with git nearly flawlessly.
2. Use an automated tool to generate the API code implementation. Again, a static generation tool such as datamodel-code-generator [1] (which generates Pydantic models) would suffice, but for Python I prefer the dynamic request routing and validation provided by pyapi-server [2].
3. Finally, I use automated testing tools such as schemathesis [3] to test the implementation against the specification.
[0] https://stoplight.io/
[1] https://koxudaxi.github.io/datamodel-code-generator/
[2] https://pyapi-server.readthedocs.io
[3] https://schemathesis.readthedocs.io
-
Create Pydantic datamodel from huge JSON file with local datamodel-code-generator
The site also provide a link to the github repo of the underlying program.
-
PSA: I think this JSON to Pydantic converter is extremely useful for boilerplate model creation
Not sure who owns/hosts the site, but its based on this github repo.
-
My top python library
That's what datamodel-code-generator propose.
-
I use attrs instead of pydantic
had generally good experience creating typed wrappers for api's with json-schema-to-pydantic[0] converter
[0] https://github.com/koxudaxi/datamodel-code-generator
-
What's the best libraries to build a REST API with Openapi compatibility
To save you some work, if you have already an OpenAPI specification at hand, you can use datamodel-code-generator to generate your Pydantic models from the spec.
-
This is what I pushed today, I don't know why but I was very positive about the code until someone reviewed it and pointed out the obvious. Also 'internal_data' field is very essential for other parts of the code. It is so embarrassing I want to disappear from the face of the earth.
And there are code generators for it! https://github.com/koxudaxi/datamodel-code-generator/
What are some alternatives?
openapi-codegen - A tool for generating code base on an OpenAPI schema.
sqlmodel - SQL databases in Python, designed for simplicity, compatibility, and robustness.
orbital - Orbital automates integration between data sources (APIs, Databases, Queues and Functions). BFF's, API Composition and ETL pipelines that adapt as your specs change.
pydantic - Data validation using Python type hints
smolblog - A blog engine for the social web. This is the monorepo that contains the PHP code for the project.
pydantic-factories - Simple and powerful mock data generation using pydantic or dataclasses
oatx - Generator-less JSONSchema types straight from OpenAPI spec
fastapi - FastAPI framework, high performance, easy to learn, fast to code, ready for production
speakeasy - Speakeasy CLI - Enterprise developer experience for your API
odmantic - Sync and Async ODM (Object Document Mapper) for MongoDB based on python type hints
openapi-generator - OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
cattrs - Composable custom class converters for attrs.