A Faker provider that generates fake blog content in Brazilian Portuguese as blog titles, blog posts, images, tags, and more.
Project description
Python Faker Blog Provider
Python Faker Blog Content Provider
Description
This Python package provides a Faker provider that generates fake blog content in Brazilian Portuguese. It consists of various methods that can be used to create blog-related fake data such as blog titles, blog posts, images, tags, and more.
Installation
Coming soon, for now you can clone this repository and use in your project:
git clone https://github.com/AdaiasMagdiel/python-faker-blog
Tests
Use the pytest to test the project:
pytest -vvsx
Usage
Import the Faker
class from the faker
package and initialize an instance of it. Then, import the BlogProvider
class from the faker_blog
module. Finally, add the BlogProvider
to the instance of Faker
.
from faker import Faker
from faker_blog import BlogProvider
fake = Faker()
fake.add_provider(BlogProvider)
# Generate fake blog content
title = fake.article_title()
image = fake.article_image()
tag = fake.article_tag()
tags = fake.article_tags(nb=5)
category = fake.article_category()
image = fake.article_image()
content_html = fake.article_content_html()
# You can generate a dictionary containing the text and a slugified version using the following methods.
title = fake.article_title_and_slug()
tag = fake.article_tag_and_slug()
tags = fake.article_tags_and_slug(nb=5)
category = fake.article_category_and_slug()
Features
- Generate fake blog titles
- Generate fake blog posts content
- Generate fake blog tag and tags
- Generate fake blog category
- Generate fake URLs for blog image using the Lorem Picsum
Examples
Generate a fake blog title:
title = fake.article_title()
print(title)
Output:
Os Segredos De Dirigir Um Poderoso Grupo
Generate fake blog tags:
tags = fake.article_tags(nb=5)
print(tags)
Output:
['Transformação Pessoal', 'Gestão do Tempo', 'Estratégias de Crescimento', 'Automação', 'Desenvolvimento Sustentável']
Generate fake blog tags with slug:
tags_and_slug = fake.article_tags_and_slug(nb=3)
print(tags_and_slug)
Output:
[{'tag': 'Ferramentas para Empreendedores', 'slug': 'ferramentas-para-empreendedores'}, {'tag': 'Transformação Digital', 'slug': 'transformacao-digital'}, {'tag': 'Cultura Empresarial', 'slug': 'cultura-empresarial'}]
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for faker_blog_provider-0.0.1a6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70cb98c6659dd71038f0907092d8c40bb62e2949e72855382b7d35ce16f5c631 |
|
MD5 | 612c14d4aa84097fbba35310c211a035 |
|
BLAKE2b-256 | 3b3d6ae710928a605b09236521b00cad433c2646f2eb5ad3298a7ed8791d7947 |
Hashes for faker_blog_provider-0.0.1a6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06d2b55fe5a78b463d15c736ff1b89b410a8c5c0bccc924711f78cf59b140aa8 |
|
MD5 | f4f2379e4320ff819a9b3dd6c5fe21a2 |
|
BLAKE2b-256 | 950b70481d428a3f86b530f302fb9b8174c9e7e26734a6b5f9b938cfd116c37a |