= Importer = [[TOC]] == Spreadsheets == Data is normally imported from spreadsheets. === XLS/X Templates === * [wiki:UserGuidelines/Importer/Excel Excel Importer] === CSV Files === Process: * File should be encoded in 'UTF-8' (with or without BOM) * Data needs putting into the correct columns * Fields containing commas should be wrapped with "" quotes * There should be no line-breaks in text fields (see [http://eden.sahanafoundation.org/raw-attachment/wiki/UserGuidelines/Importer/cleanCSV.py cleanCSV.py] for help with this) * Date formats need to be correct: [http://en.wikipedia.org/wiki/ISO_8601 ISO8601] * If the file is very large, then it can be better to split into multiple files to avoid memory exhaustion (see [http://eden.sahanafoundation.org/raw-attachment/wiki/UserGuidelines/Importer/splitCSV.py splitCSV.py] for help with this) This can be done to [DeveloperGuidelines/PrePopulate PrePopulate] an instance. After 1st run, there are menu links for many resources, but any REST controller can have the 'import' method invoked if there is a suitable .xsl file as {{{static/formats/s3csv/module/resource.xsl}}}: {{{ http://host.domain/module/resource/import }}} Files & Stylesheets can be loaded from alternate sources, such as: {{{ http://host.domain/eden/hrm/person.s3csv/create?fetchurl=http://my.host/HR.csv&transform=/home/web2py/applications/eden/static/formats/s3csv/hrm_import.xsl }}} Alternately these can be done using CLI scripts: * [wiki:S3/DataImportCLI DataImportCLI] == !OpenStreetMap == XSLT available to import Hospitals & Locations into Sahana Eden * [wiki:GIS/OpenStreetMap#Import] * http://127.0.0.1:8000/eden/hms/hospital/create.osm?filename=c:\archives\gis-gps\data\americas\haiti\haiti_hospital.osm !ToDo: Provide a UI to select which levels the admin boundary levels correspond to: * Contribute/Code#OSMImporterUI == Ushahidi == XSLT available to import Ushahidi reports into Sahana Eden's Incident Reporting system * Access only available to Administrators: http://127.0.0.1:8000/eden/irs/ireport/ushahidi * URL to enter is http://instancename.crowdmap.com/api/%3Ftask=incidents%26by=all%26resp=xml == See Also == * BluePrint/Importer * DeveloperGuidelines/PrePopulate * [wiki:S3/DataImportCLI DataImportCLI] * [wiki:S3/S3XML/Transformation On-the-fly Transformation using external Stylesheets] * [UserGuidelines/Importer/Old Old User Guidelines] * Can try to use this to clean up data: http://openrefine.org