Giter VIP home page Giter VIP logo

attr's Introduction

attr

Simple decorator to set attributes of target function or class in a DRY way.

Usage example:

# Django proposes:
def my_calculated_field(...
my_calculated_field.short_description = 'Field'
my_calculated_field.admin_order_field = 'real_field'

# DRY:
@attr(short_description='Field', admin_order_field='real_field')
def my_calculated_field(...

Get it:

sudo pip install attr
from attr import attr

New popular http://attrs.org used by https://pytest.org defines another "attr" package that shadows this "attr" module.
Please use "dry_attr" alias to unshadow it:

from dry_attr import attr
from dry_attr import dry_attr

attr version 0.3.2
Copyright (C) 2013-2022 by Denis Ryzhkov [email protected]
MIT License

attr's People

Contributors

denis-ryzhkov avatar toddrme2178 avatar merwok avatar

Stargazers

zengqingfu1442 avatar Jorge Gomez avatar  avatar Nico Müller avatar Leonardo avatar Daniel Umpierrez avatar  avatar Matt Copperwaite avatar

Watchers

James Cloos avatar  avatar

attr's Issues

License file

I am trying to package attr for openSUSE. However, there is no license file I can find, either in the github or tarball. In order for people to know how they can use your code it is really important to have a license file. Would it be possible to add one? Thank you.

Conda Package

This package doesn't seem to be in conda-forge (for installation as a conda package).

I can take a stab at putting together a feedstock. @denis-ryzhkov would you be ok to be listed as a maintainer?

You wouldn't really have to do anything except merge an auto generated PR if you cut a new release of the pypi package (conda-forge automatically tracks pypi.

Publish tags for releases

Hello,

Could you create and push git tags for each release? It would help for example tools that make pull requests to update dependencies and try to generate a changelog.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.