solidaires-informatique/sirene 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

solidaires-informatique/sirene

最新稳定版本:2.0.0

Composer 安装命令:

composer require solidaires-informatique/sirene

包简介

Retrieves company and establishment data from the SIRENE's Insee API

README 文档

README

Retrieves company and establishment data from the SIRENE's Insee API

Usage

Code

Method on Sirene's instances:

  • rawSiret(string $siret): array to get data from the API as array
  • siret(string $siret): Etablissement to get data from the API as Etablissement
  • rawSiren(string $siren): array to get data from the API as array
  • siren(string $siren): UniteLegale to get data from the API as UniteLegale

Example:

$workplace = (new Sirene(apiKey: 'SUPER-SECRET-API-KEY'))->siret('13000766900018');
echo (string) $workplace->address;

Get an API KEY

You'll need an account on https://portail-api.insee.fr/ (“connexion pour les externes”):

1) Create an application in https://portail-api.insee.fr/applications/creation (choose a name and fill the description field) 2) Select "Simple" in the "Sécurité" step. 3) Left the client id empty 4) Select "API Sirene" in the "Souscription" step and click on "Souscrire". 5) Select your application in https://portail-api.insee.fr/applications/mine and go to "Subscriptions" 6) Select "API Sirene", retrieve your API key.

Issues, suggestions and contributions

Please open an issue at https://gitlab.com/solidaires-informatique/sirene/-/issues

Dev tools

Code style verifications:

vendor/bin/php-cs-fixer fix --dry-run -v --diff

Static analysis:

vendor/bin/phpstan analyse --memory-limit=250M

Tests:

./vendor/bin/pest

To run RealTest that really call the Insee's API you'll need an API key from Insee : 1) Retrieve an API KEY (follow "Auth" part of README) 2) Copy phpunit.xml.dist to phpunit.xml. 3) Fill the API_KEY with your key.

Licence

Licensed under GNU Affero General Public License v3.0 (AGPL-3.0), read more at https://choosealicense.com/licenses/agpl-3.0/

统计信息

  • 总下载量: 581
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2023-05-24