Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

faker-blog-provider

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faker-blog-provider

A Faker provider that generates fake blog content in Brazilian Portuguese as blog titles, blog posts, images, tags, and more.

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

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

Use pip for install from source in PyPI:

pip install faker-blog-provider

Tests

Use 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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc