🐍 8 backend repos used by the top 1% of python devs 🏆
Tags: python, programming, webdev, productivity
Published: 2024-01-04 12:05:38

Hi there 👋

Today, let's look into 8 Python repos that **the top 1% of developers use** (and those you have likely never heard of). 


Ready? 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bzvvmg6vufcw2jbly38b.gif)



---


# How do we find the repos used by the top 1% of devs? 🔎 

At Quira, we rank developers based on their **[DevRank](https://docs.quira.sh/for-developers/devrank)**. 

In simple terms, DevRank uses [Google’s PageRank algorithm](https://en.wikipedia.org/wiki/PageRank) to measure **how important a developer is in open source based on their contributions to open source repos.**

We thus look at the repos that the top 1% have starred. We then calculate the likelihood that the top 1% of developers will star a repo compared to the likelihood that the bottom 50% won’t. 

Lastly, after a bit of hand-picking, we found our 8 final repos.  📊👇


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqb51epka2yn93kefmlu.png)

_Note: We use stars as a rough measure of usage. Whilst this method isn't perfect, we recognise it offers insight into the tools favoured by top developers._


---

These repos will be **particularly useful when building projects with a robust backend.**

If you are interested in working on building small apps, and you enjoy the applied AI side, we recommend you check out [Creator Quests](https://quira.sh/?utm_source=devto&utm_campaign=python_backend), an **open-source challenge that rewards developers for creating cool GenerativeAI apps** with ChatGPT, Claude, Gemini and more. :upside_down_face: 💰


The latest Creator Quest challenges you to build developer tools using Generative AI. To participate, simply sign up to [Quira](https://quira.sh/?utm_source=devto&utm_campaign=python_backend) and head to _Quests_. 

**The current prize pool is $2048**, and it will increase as more participants join! Click on the image below and give it a try! ⬇️


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3uaum14qy7jc0zs064p.png)](https://quira.sh/?utm_source=devto&utm_campaign=python_backend)


Enough about this; let's dive into our findings and how you can benefit from them! 👇

---


# 🕸️ aio-libs/yarl


**The URL library you have never heard of**


**Why should you care?**  Yarl is designed for easy and efficient URL management and analysis in Python. It handles encoding and decoding, allowing you to create, analyze and modify URLs in a simple way.


**Set up**: `pip install yarl`

**Example use case**: 


```python
from yarl import URL
url = URL('https://www.python.org/~guido?arg=1#frag')

# All url parts: scheme, user, password, host, port, path, query and fragment are accessible by properties:

>>> url.scheme
'https'
>>>  url.host
'www.python.org'
>>> url.path
'/~guido'
>>> url.query_string
'arg=1'
>>> url.query
<MultiDictProxy('arg': '1')>
>>> url.fragment
'frag'

```


[https://github.com/aio-libs/yarl](https://github.com/aio-libs/yarl)


---


# 🗃️ Suor/django-cacheops


**Your new caching best friend**

**Why should you care?**  Django-cacheops is a Django application that uses Redis to provide advanced caching capabilities, including automatic query caching and event-based automatic caching. It can speed up Django applications by reducing data load and has features like function and view caching.


**Set up**: `pip install django-cacheops`

**Example use case:**

```python

# Function caching
from cacheops import cached_as

@cached_as(Article, timeout=120)
def article_stats():
    return {
        'tags': list(Article.objects.values('tag').annotate(Count('id')))
        'categories': list(Article.objects.values('category').annotate(Count('id')))
    }

```


[https://github.com/Suor/django-cacheops](https://github.com/Suor/django-cacheops)


---


# 👀 samuelcolvin/watchfiles


**File watching and code reload in Python**


**Why should you care?** Watchfiles are essential because they automatically reset your code every time you make a change. This means you won't have to restart your server every time you update your content. It is also very easy to install and work on different projects, making your development process smoother and more efficient.



**Set up**: `pip install watchfiles`
**Example use case**: `watch` usage


```python

from watchfiles import watch

for changes in watch('./path/to/dir'):
    print(changes)

```

[https://github.com/samuelcolvin/watchfiles](https://github.com/samuelcolvin/watchfiles)

---

# 🧪 FactoryBoy/factory_boy

**Test your Python apps with fake but realistic data**

**Why should you care?** Factory_boy is a tool that helps you quickly create fake but realistic data to test your Python application. It's like having an assistant who can automatically create any test case you need. This makes it easier to check whether your application works well in different situations.


**Set up:** `pip install factory_boy`

**Example use case:**

```python

class FooTests(unittest.TestCase):

    def test_with_factory_boy(self):
        # We need a 200€, paid order, shipping to australia, for a VIP customer
        order = OrderFactory(
            amount=200,
            status='PAID',
            customer__is_vip=True,
            address__country='AU',
        )
        # Run the tests here

    def test_without_factory_boy(self):
        address = Address(
            street="42 fubar street",
            zipcode="42Z42",
            city="Sydney",
            country="AU",
        )
        customer = Customer(
            first_name="John",
            last_name="Doe",
            phone="+1234",
            email="john.doe@example.org",
            active=True,
            is_vip=True,
            address=address,
        )
        # etc.


```


[https://github.com/FactoryBoy/factory_boy](https://github.com/FactoryBoy/factory_boy)



---


# 💽 hugapi/hug


**Developing APIs as simple as possible.**



**Why should you care?**  Hug is a framework that easily creates APIs in Python and is designed to protect your code as much as possible. It is made for fast and self-documenting code support, making your development more intuitive. 


**Set up**: `pip3 install hug --upgrade`
**Example use case**: 


```python

# Build an example API with a simple endpoint in just a few lines.

# filename: happy_birthday.py
"""A basic (single function) API written using hug"""
import hug


@hug.get('/happy_birthday')
def happy_birthday(name, age:hug.types.number=1):
    """Says happy birthday to a user"""
    return "Happy {age} Birthday {name}!".format(**locals())


```

[https://github.com/hugapi/hug](https://github.com/hugapi/hug)

---


# 📑 joeyespo/grip


**Preview GitHub README.md files locally before committing them.**


**Why should you care?** Grip allows you to use GitHub's own Markdown API to create local Markdown archives (like a README) before pushing to GitHub. This is great for getting your files directly to GitHub without the trial and error of pushing and reviewing.


**Set up**: `pip install grip` or for brew users `brew install grip`

**Example use case**: 

```
# To render the readme of a repository

$ cd myrepo
$ grip
 * Running on http://localhost:6419/

```


[https://github.com/joeyespo/grip](https://github.com/joeyespo/grip)

---


# 🔎 joerick/pyinstrument


**Find why and where your code is slow!**


**Why should you care?** Pyinstrument is a performance analysis tool that helps you identify areas of your code that are slowing down your application. You can run your script as usual and get detailed information about where it spends the most time, helping you tune your code to be more efficient. 


**Set up**: `pip install pyinstrument`
**Example use case**: 


```python

# Instead of writing python script.py, type pyinstrument script.py. 
# Your script will run as normal, and at the end (or when you press ^C)
# Pyinstrument will output a colored summary showing where most of the time was spent.


# Pyinstrument also has a Python API. Just surround your code with Pyinstrument, like this:

from pyinstrument import Profiler

profiler = Profiler()
profiler.start()

# code you want to profile

profiler
.stop()

profiler.print()
```


[https://github.com/joerick/pyinstrument](https://github.com/joerick/pyinstrument)


---



# ✍️ marshmallow-code/apispec


**A pluggable API specification generator**


**Why should you care?** Apispec is a tool for creating API documentation with specific support for the OpenAPI specification. This means it automatically creates a clear, structured document for your API endpoint.  

**Set up**: `pip install -U apispec`

**Example use case**: 


```python
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec_webframeworks.flask import FlaskPlugin
from flask import Flask
from marshmallow import Schema, fields


# Create an APISpec
spec = APISpec(
    title="Swagger Petstore",
    version="1.0.0",
    openapi_version="3.0.2",
    plugins=[FlaskPlugin(), MarshmallowPlugin()],
)

# Optional marshmallow support
class CategorySchema(Schema):
    id = fields.Int()
    name = fields.Str(required=True)


class PetSchema(Schema):
    category = fields.List(fields.Nested(CategorySchema))
    name = fields.Str()


# Optional security scheme support
api_key_scheme = {"type": "apiKey", "in": "header", "name": "X-API-Key"}
spec.components.security_scheme("ApiKeyAuth", api_key_scheme)


# Optional Flask support
app = Flask(__name__)


@app.route("/random")
def random_pet():
    """A cute furry animal endpoint.
    ---
    get:
      description: Get a random pet
      security:
        - ApiKeyAuth: []
      responses:
        200:
          content:
            application/json:
              schema: PetSchema
    """
    pet = get_random_pet()
    return PetSchema().dump(pet)


# Register the path and the entities within it
with app.test_request_context():
    spec.path(view=random_pet)

```


[https://github.com/marshmallow-code/apispec](https://github.com/marshmallow-code/apispec)

---



**I hope our discoveries are valuable and will help you build a robust backend toolkit! ⚒️**

If you want to leverage these tools today to earn rewards, we have just launched a challenge to build a developer tool using Generative AI. 

If that's of interest, log into [Quira](https://quira.sh/?utm_source=devto&utm_campaign=python_backend) and discover Quests! 💰


It's time to code, have fun and bag some awesome rewards. 🤘


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2bwbugifek4e417p6wpl.gif)



Lastly, please **consider supporting these projects by starring them. ⭐️**

PS: We are not affiliated with them. We just think that great projects deserve great recognition.


See you next week,

Your Dev.to buddy 💚

Bap

---

If you want to join the self-proclaimed "coolest" server in open source 😝, you should join our [discord server](https://discord.com/invite/ChAuP3SC5H/?utm_source=devto&utm_campaign=). We are here to help you on your journey in open source. 🫶


{% embed [https://dev.to/quira](https://dev.to/quira) %}