
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
Add an option in Config to choose which fields to use in __repr_args__ Β· Issue #1831 Β· pydantic/pydantic
Description:
I may have missed something, but it seems there is no way to exclude a field from an object's representation Feature Request I think it would be nice to have an option in Config to choose which...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Fitness & Wellness
- Luxury
- Science
Content Management System {π}
What CMS is github.com built with?
Github.com uses WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 4,989,889 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,532.
The estimated annual recurring revenues (ARR) are $251,490,385.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
class, config, repr, fields, option, field, reprargs, str, key, commented, bool, sign, choose, issue, lotram, exclude, request, solution, basemodel, false, pydantic, add, representation, feature, include, return, fieldsinrepr, usermodel, login, jab, reprfalse, fnep, mentioned, navigation, pull, requests, actions, security, closed, description, objects, nice, dont, find, convenient, multiple, models, import, list, def,
Topics {βοΈ}
personal information add multiple big models add repr parameter typing import list comment metadata assignees completed mattwthompson mentioned python module reprlib repr implementation shipped field definition site optional[list[str]] = similar request login='lotram' include additional fields bytes = pydantic long description type projects python file default reprlib additional parameterization multiple attributes class user baseconfig class field class it176131 mentioned lotram repr=false bool = false class config config class union['abstractsetintstr' issue real problem simpler __repr__ projects milestone milestone relationships class reducedrepresentation repr boolean repr participation repr inside str = field pydantic def __repr_args__ model config custom config desired fields filter/configuration github [enh] -- option good solution exclude model_extra
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
- Ib())?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:Add an option in Config to choose which fields to use in __repr_args__
articleBody:I may have missed something, but it seems there is no way to exclude a field from an object's representation
# Feature Request
I think it would be nice to have an option in Config to choose which fields to use in `__repr_args__`.
Another solution would be to include an `repr` boolean in the `Field` class, exactly like in dataclasses. I don't find it as convenient as the other solution, but maybe it makes more sense, since it's a per-field option.
# Why
I have multiple big models ( more than 10 fields) and I'd like to reduce the size of their representation (either when using `str()` or `repr()`
So I could override the `BaseModel` to do something like this:
```py
from typing import List, Optional
from pydantic import BaseModel
class Model(BaseModel):
def __repr_args__(self):
if self.Config._fields_in_repr is None:
return super().__repr_args__()
return (
(key, value)
for key, value in super().__repr_args__()
if key in self.Config._fields_in_repr
)
class Config:
_fields_in_repr: Optional[List[str]] = None
class User(Model):
id: int
login: str
bio: str
# lot of other fields
class Config:
_fields_in_repr = ["id", "login"]
user = User(id=1, login="Lotram", bio="This could be a rather long description, I don't want it in the the repr")
repr(user) # "User(id=1, login='Lotram')"
```
However, IMHO we almost always want to exclude some fields from the object's repr, and I feel like this is generic enough to justify a new option in the `BaseConfig` class.
author:
url:https://github.com/Lotram
type:Person
name:Lotram
datePublished:2020-08-13T16:12:09.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:5
url:https://github.com/1831/pydantic/issues/1831
context:https://schema.org
headline:Add an option in Config to choose which fields to use in __repr_args__
articleBody:I may have missed something, but it seems there is no way to exclude a field from an object's representation
# Feature Request
I think it would be nice to have an option in Config to choose which fields to use in `__repr_args__`.
Another solution would be to include an `repr` boolean in the `Field` class, exactly like in dataclasses. I don't find it as convenient as the other solution, but maybe it makes more sense, since it's a per-field option.
# Why
I have multiple big models ( more than 10 fields) and I'd like to reduce the size of their representation (either when using `str()` or `repr()`
So I could override the `BaseModel` to do something like this:
```py
from typing import List, Optional
from pydantic import BaseModel
class Model(BaseModel):
def __repr_args__(self):
if self.Config._fields_in_repr is None:
return super().__repr_args__()
return (
(key, value)
for key, value in super().__repr_args__()
if key in self.Config._fields_in_repr
)
class Config:
_fields_in_repr: Optional[List[str]] = None
class User(Model):
id: int
login: str
bio: str
# lot of other fields
class Config:
_fields_in_repr = ["id", "login"]
user = User(id=1, login="Lotram", bio="This could be a rather long description, I don't want it in the the repr")
repr(user) # "User(id=1, login='Lotram')"
```
However, IMHO we almost always want to exclude some fields from the object's repr, and I feel like this is generic enough to justify a new option in the `BaseConfig` class.
author:
url:https://github.com/Lotram
type:Person
name:Lotram
datePublished:2020-08-13T16:12:09.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:5
url:https://github.com/1831/pydantic/issues/1831
Person:
url:https://github.com/Lotram
name:Lotram
url:https://github.com/Lotram
name:Lotram
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:5
interactionType:https://schema.org/CommentAction
userInteractionCount:5
External Links {π}(5)
- Discover the revenue of https://github.blog
- Find out how much https://docs.python.org/3.8/library/reprlib.html?highlight=repr#reprlib.Repr earns monthly
- What is the monthly revenue of https://docs.python.org/3/library/dataclasses.html#dataclasses.field?
- How profitable is https://www.attrs.org/en/stable/api.html#attr.ib?
- Revenue of https://www.githubstatus.com/
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net