
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
This gem provide a easy way to integrate an application to Correios Sigep Web API, all features is based on this API documentation
You can add it to your Gemfile with:
gem 'sigep_web'
or in your console:
gem install sigep_web
If you are using Rails put this in your environments configuration files:
SigepWeb.configure do |config|
config.user = 'YOUR_USER'
config.password = 'YOUR_PASSWORD'
config.administrative_code = 'YOUR_ADM_CODE'
config.card = 'YOUR_CARD_NUMBER'
config.contract = 'YOUR_CONTRACT_NUMBER'
end
This check whether a particular service is available from source zip code to target zip code.
SigepWeb.service_availability(service_number: '40215',
source_zip: '70002900',
target_zip: '74730490')
This method will return a hash like this if has a success response, the second attribute indicate if a particular service is available.
{ success: true, response: true }
This method return the available services of specific post card
SigepWeb.search_client(id_contract: "0000000000",
id_post_card: "0000000000")
The method will return something like this
{
success: true,
response: {
cnpj: '0000000000',
contratos: {
cartoes_postage: {
codigo_administrativo: '000000000',
numero: '000000000',
servicos: [
{
codigo: '40096',
descricao: 'SEDEX - CONTRATO',
id: '104625'
},
...
]
}
}
}
}
This method return the address based on zip code
SigepWeb.zip_query(zip: "70002900")
This method will return a hash like this
{
success: true,
response: {
bairro: 'Asa Norte',
cep: '70002900',
cidade: 'Brasília',
complemento: nil,
complemento2: nil,
end: 'SBN Quadra 1 Bloco A',
id: '0',
uf: 'DF'
}
}
Return one label or a range of labels to use for posts
SigepWeb.request_labels(receiver_type: 'C', identifier: '00000000000000',
id_service: '104625', qt_labels: 1)
return:
{ success: true, response: ['DL61145929 BR'] }
to generate the verifying digit for a specific label use:
SigepWeb.generate_labels_digit_verifier(labels: 'DL61145929 BR')
return:
{ success: true, response: 6 }
use the SigepWeb::Models::Receiver to create receiver structure:
SigepWeb::Models::Receiver.new(name: 'Josefina', email: 'josefina@foo.com',
number: '10', address: 'Rua X',
complement: 'Perto da rua X+1',
neighborhood: 'Bairro X-1',
city: 'Cidade Y', uf: 'SP', amount: '0,0',
cep: '04105-070')
use the SigepWeb::Models::DimensionObject to create object dimensions:
SigepWeb::Models::DimensionObject.new(object_type: '002', height: '20',
width: '30', length: '38',
diameter: '0')
use the SigepWeb::Models::PostalObject to create post object:
SigepWeb::Models::PostalObject.new(label_number: 'DL611459296BR',
postage_code_service: '40096',
cubage: 0.0, weight: '400',
receiver: receiver,
dimension_object: dimension_object,
processing_status: '0')
SigepWeb::Models::Sender.new(directorship_number: '16', name: 'Loja X',
address: 'Rua X', number: '10',
complement: 'perto da rua X+1',
neighborhood: 'Bairro Y',
zip_code: '7400000', city: 'Goiânia',
uf: 'GO', email: 'contato@loja_x.com.br',
postal_objects: postal_objects)
SigepWeb.request_plp_services(plp: sender, id_plp_client: 00_000_000,
labels: labels)
FAQs
Unknown package
We found that sigep_web demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.