legigo

package module
v0.0.0-...-e7cfa2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2017 License: MIT Imports: 2 Imported by: 0

README

Build Status Coverage Status

legigo

Go (golang) library to explore LEGI files available at https://www.data.gouv.fr/fr/datasets/legi-codes-lois-et-reglements-consolides/

Inline Documentation: https://godoc.org/github.com/feloy/legigo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	XMLName xml.Name `xml:"ARTICLE"`
	// META
	// - META_COMMUN
	Id       string `xml:"META>META_COMMUN>ID"`
	AncienId string `xml:"META>META_COMMUN>ANCIEN_ID"`
	Origine  string `xml:"META>META_COMMUN>ORIGINE"`
	Url      string `xml:"META>META_COMMUN>URL"`
	Nature   string `xml:"META>META_COMMUN>NATURE"`
	// - META_SPEC
	//   - META_ARTICLE
	DateDebut string `xml:"META>META_SPEC>META_ARTICLE>DATE_DEBUT"`
	DateFin   string `xml:"META>META_SPEC>META_ARTICLE>DATE_FIN"`
	Etat      string `xml:"META>META_SPEC>META_ARTICLE>ETAT"`
	Num       string `xml:"META>META_SPEC>META_ARTICLE>NUM"`
	Type      string `xml:"META>META_SPEC>META_ARTICLE>TYPE"`

	Contexte Contexte `xml:"CONTEXTE>TEXTE"`

	Versions []Version `xml:"VERSIONS>VERSION"`

	BlocTextuel struct {
		Contenu string `xml:",innerxml"`
	} `xml:"BLOC_TEXTUEL>CONTENU"`
	Nota struct {
		Contenu string `xml:",innerxml"`
	} `xml:"NOTA>CONTENU"`

	Liens []Lien `xml:"LIENS>LIEN"`
}

func DecodeArticle

func DecodeArticle(filename string) (*Article, error)

type Contexte

type Contexte struct {
	Autorite      string   `xml:"autorite,attr"`
	Cid           string   `xml:"cid,attr"`
	DatePubli     string   `xml:"date_publi,attr"`
	DateSignature string   `xml:"date_signature,attr"`
	Ministere     string   `xml:"ministere,attr"`
	Nature        string   `xml:"nature,attr"`
	Nor           string   `xml:"nor,attr"`
	Num           string   `xml:"num,attr"`
	TitreTxt      TitreTxt `xml:"TITRE_TXT"`
	Tm            Tm       `xml:"TM"`
}

Used in SectionTa and Article

type Lien

type Lien struct {
	CidTexte       string `xml:"cidtexte,attr"`
	DateSignaTexte string `xml:"datesignatexte,attr"`
	Id             string `xml:"id,attr"`
	NatureTexte    string `xml:"naturetexte,attr"`
	NorTexte       string `xml:"nortexte,attr"`
	Num            string `xml:"num,attr"`
	NumTexte       string `xml:"numtexte,attr"`
	Sens           string `xml:"sens,attr"`
	TypeLien       string `xml:"typelien,attr"`
	Contenu        string `xml:",chardata"`
}

type LienArt

type LienArt struct {
	Debut   string `xml:"debut,attr"`
	Etat    string `xml:"etat,attr"`
	Fin     string `xml:"fin,attr"`
	Id      string `xml:"id,attr"`
	Num     string `xml:"num,attr"`
	Origine string `xml:"origine,attr"`
}

Used in Textelr and SectionTa and Article

type LienSectionTa

type LienSectionTa struct {
	Cid     string `xml:"cid,attr"`
	Debut   string `xml:"debut,attr"`
	Etat    string `xml:"etat,attr"`
	Fin     string `xml:"fin,attr"`
	Id      string `xml:"id,attr"`
	Niv     string `xml:"niv,attr"`
	Url     string `xml:"url,attr"`
	Contenu string `xml:",chardata"`
}

Used in Textelr and SectionTa

type LienTxt

type LienTxt struct {
	Debut string `xml:"debut,attr"`
	Fin   string `xml:"fin,attr"`
	Id    string `xml:"id,attr"`
	Num   string `xml:"num,attr"`
}

type SectionTa

type SectionTa struct {
	XMLName        xml.Name        `xml:"SECTION_TA"`
	Id             string          `xml:"ID"`
	TitreTa        string          `xml:"TITRE_TA"`
	Commentaire    string          `xml:"COMMENTAIRE"`
	LiensArt       []LienArt       `xml:"STRUCTURE_TA>LIEN_ART"`
	LiensSectionTa []LienSectionTa `xml:"STRUCTURE_TA>LIEN_SECTION_TA"`
	Contexte       Contexte        `xml:"CONTEXTE>TEXTE"`
}

func DecodeSectionTa

func DecodeSectionTa(filename string) (*SectionTa, error)

DecodeSectionTa decodes a LEGI file describing a "Section Texte Article"

type TexteVersion

type TexteVersion struct {
	XMLName xml.Name `xml:"TEXTE_VERSION"`
	// META
	// - META_COMMUN
	Id       string `xml:"META>META_COMMUN>ID"`
	AncienId string `xml:"META>META_COMMUN>ANCIEN_ID"`
	Origine  string `xml:"META>META_COMMUN>ORIGINE"`
	Url      string `xml:"META>META_COMMUN>URL"`
	Nature   string `xml:"META>META_COMMUN>NATURE"`
	// - META_SPEC
	//   - META_TEXTE_CHRONICLE
	Cid                  string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>CID"`
	Num                  string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>NUM"`
	NumSequence          string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>NUM_SEQUENCE"`
	Nor                  string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>NOR"`
	DatePubli            string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>DATE_PUBLI"`
	DateTexte            string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>DATE_TEXTE"`
	DerniereModification string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>DERNIERE_MODIFICATION"`
	VersionsAVenir       []string `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>VERSIONS_A_VENIR>VERSION_A_VENIR"`
	OriginePubli         string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>ORIGINE_PUBLI"`
	PageDebPubli         string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>PAGE_DEB_PUBLI"`
	PageFinPubli         string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>PAGE_FIN_PUBLI"`
	//   - META_TEXTE_VERSION
	Autorite  string `xml:"META>META_SPEC>META_TEXTE_VERSION>AUTORITE"`
	DateDebut string `xml:"META>META_SPEC>META_TEXTE_VERSION>DATE_DEBUT"`
	DateFin   string `xml:"META>META_SPEC>META_TEXTE_VERSION>DATE_FIN"`
	Etat      string `xml:"META>META_SPEC>META_TEXTE_VERSION>ETAT"`
	Liens     []Lien `xml:"META>META_SPEC>META_TEXTE_VERSION>LIENS>LIEN"`
	Ministere string `xml:"META>META_SPEC>META_TEXTE_VERSION>MINISTERE"`
	Titre     string `xml:"META>META_SPEC>META_TEXTE_VERSION>TITRE"`
	TitreFull string `xml:"META>META_SPEC>META_TEXTE_VERSION>TITREFULL"`
	Visas     struct {
		Contenu string `xml:",innerxml"`
	} `xml:"VISAS>CONTENU"`
	Signataires struct {
		Contenu string `xml:",innerxml"`
	} `xml:"SIGNATAIRES>CONTENU"`
	Tp struct {
		Contenu string `xml:",innerxml"`
	} `xml:"TP>CONTENU"`
	Nota struct {
		Contenu string `xml:",innerxml"`
	} `xml:"NOTA>CONTENU"`
	Abro struct {
		Contenu string `xml:",innerxml"`
	} `xml:"ABRO>CONTENU"`
	Rect struct {
		Contenu string `xml:",innerxml"`
	} `xml:"RECT>CONTENU"`
}

func DecodeTexteVersion

func DecodeTexteVersion(filename string) (*TexteVersion, error)

type Textelr

type Textelr struct {
	XMLName xml.Name `xml:"TEXTELR"`
	// META
	// - META_COMMUN
	Id       string `xml:"META>META_COMMUN>ID"`
	AncienId string `xml:"META>META_COMMUN>ANCIEN_ID"`
	Origine  string `xml:"META>META_COMMUN>ORIGINE"`
	Url      string `xml:"META>META_COMMUN>URL"`
	Nature   string `xml:"META>META_COMMUN>NATURE"`
	// - META_SPEC
	//   - META_TEXTE_CHRONICLE
	Cid                  string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>CID"`
	Num                  string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>NUM"`
	NumSequence          string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>NUM_SEQUENCE"`
	Nor                  string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>NOR"`
	DatePubli            string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>DATE_PUBLI"`
	DateTexte            string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>DATE_TEXTE"`
	DerniereModification string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>DERNIERE_MODIFICATION"`
	VersionsAVenir       []string `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>VERSIONS_A_VENIR>VERSION_A_VENIR"`
	OriginePubli         string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>ORIGINE_PUBLI"`
	PageDebPubli         string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>PAGE_DEB_PUBLI"`
	PageFinPubli         string   `xml:"META>META_SPEC>META_TEXTE_CHRONICLE>PAGE_FIN_PUBLI"`
	// VERSIONS
	Versions []Version `xml:"VERSIONS>VERSION"`
	// STRUCT
	LiensArt       []LienArt       `xml:"STRUCT>LIEN_ART"`
	LiensSectionTa []LienSectionTa `xml:"STRUCT>LIEN_SECTION_TA"`
}

func DecodeTextelr

func DecodeTextelr(filename string) (*Textelr, error)

type TitreTm

type TitreTm struct {
	Debut   string `xml:"debut,attr"`
	Fin     string `xml:"fin,attr"`
	Id      string `xml:"id,attr"`
	Contenu string `xml:",chardata"`
}

type TitreTxt

type TitreTxt struct {
	CTitreCourt string `xml:"c_titre_court,attr"`
	Debut       string `xml:"debut,attr"`
	Fin         string `xml:"fin,attr"`
	IdTxt       string `xml:"id_txt,attr"`
	Contenu     string `xml:",chardata"`
}

type Tm

type Tm struct {
	TitreTm TitreTm `xml:"TITRE_TM"`
	Tm      *Tm     `xml:"TM"`
}

type Version

type Version struct {
	Etat    string  `xml:"etat,attr"`
	LienTxt LienTxt `xml:"LIEN_TXT"`
	LienArt LienArt `xml:"LIEN_ART"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL