pydantic-factories
datamodel-code-generator
pydantic-factories | datamodel-code-generator | |
---|---|---|
11 | 9 | |
8 | 2,879 | |
- | 3.0% | |
7.6 | 9.1 | |
almost 2 years ago | 1 day ago | |
Python | Python | |
MIT License | 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.
pydantic-factories
-
Starlite: v1.27.0 updates
Last but not least, we moved pydantic-factories from my GitHub namespace (Goldziher) into the starlite-api GitHub organization, so its now an official package of the org.
-
Looking for contributors and maintainers
I'm the author and sole maintainer of a library called pydantic-factories.
-
Pydantic-Factories: Type Based mock data generation
You can see the docs here.
-
GitHub - Goldziher/pydantic-factories: Pydantic based mock data generation
Here is the link: https://github.com/Goldziher/pydantic-factories
- What is a normal pylint score and what is its significance?
-
pydantic-factories v1.0.0
I'm glad to say pydantic-factories is now at v1.0.0 and includes support for pydantic v1.9.0+.
- Ask HN: Good Python projects to read for modern Python?
-
pydantic-factories
So - some of you perhaps read my previous post regarding pydantic-factories, but for those who didn't- its a python package that allows you to generate mock data for your pydantic models and dataclasses. It also works for vanilla python dataclasses, so its actually not only for pydantic.
-
How to take off an open-source project?
looking at your badges - i don't care your "docs" pipeline is passing, what I am not seeing is test coverage. I suggest you checkout integrating sonar-cloud with your github repository. You can see how this looks here: https://github.com/Goldziher/pydantic-factories
-
Pydantic Factories
Here is a link to the repository - https://github.com/Goldziher/pydantic-factories, I would of course love getting more stars. But I would especially love getting more users and contributors - really do feel free to add PRs, write issues and suggestions etc.
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?
odmantic - Sync and Async ODM (Object Document Mapper) for MongoDB based on python type hints
sqlmodel - SQL databases in Python, designed for simplicity, compatibility, and robustness.
fastapi-dramatiq-data-ingestion - Sample project showing reliable data ingestion application using FastAPI and dramatiq
pydantic - Data validation using Python type hints
FastAPI-template - Feature rich robust FastAPI template.
fastapi - FastAPI framework, high performance, easy to learn, fast to code, ready for production
asgi-correlation-id - Request ID propagation for ASGI apps
cattrs - Composable custom class converters for attrs, dataclasses and friends.
PDM - A modern Python package and dependency manager supporting the latest PEP standards
django-ninja - 💨 Fast, Async-ready, Openapi, type hints based framework for building APIs