from ecmwfapi import ECMWFDataServer

server = ECMWFDataServer()
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1979-01-01/to/1979-12-31",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1979-01-01.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1980-01-01/to/1980-12-30",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1980-01-01.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1980-12-31/to/1981-12-30",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1980-12-31.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1981-12-31/to/1982-12-30",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1981-12-31.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1982-12-31/to/1983-12-30",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1982-12-31.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1983-12-31/to/1984-12-29",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1983-12-31.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1984-12-30/to/1985-12-29",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1984-12-30.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1985-12-30/to/1986-12-29",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1985-12-30.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1986-12-30/to/1987-12-29",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1986-12-30.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1987-12-30/to/1988-12-28",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1987-12-30.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1988-12-29/to/1989-12-28",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1988-12-29.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1989-12-29/to/1990-12-28",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1989-12-29.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1990-12-29/to/1991-12-28",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1990-12-29.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1991-12-29/to/1992-12-27",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1991-12-29.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1992-12-28/to/1993-12-27",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1992-12-28.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1993-12-28/to/1994-12-27",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1993-12-28.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1994-12-28/to/1995-12-27",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1994-12-28.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1995-12-28/to/1996-12-26",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1995-12-28.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1996-12-27/to/1997-12-26",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1996-12-27.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1997-12-27/to/1998-12-26",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1997-12-27.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1998-12-27/to/1999-12-26",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1998-12-27.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "1999-12-27/to/2000-12-25",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '1999-12-27.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2000-12-26/to/2001-12-25",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2000-12-26.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2001-12-26/to/2002-12-25",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2001-12-26.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2002-12-26/to/2003-12-25",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2002-12-26.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2003-12-26/to/2004-12-24",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2003-12-26.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2004-12-25/to/2005-12-24",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2004-12-25.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2005-12-25/to/2006-12-24",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2005-12-25.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2006-12-25/to/2007-12-24",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2006-12-25.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2007-12-25/to/2008-12-23",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2007-12-25.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2008-12-24/to/2009-12-23",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2008-12-24.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2009-12-24/to/2010-12-23",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2009-12-24.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2010-12-24/to/2011-12-23",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2010-12-24.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2011-12-24/to/2012-12-22",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2011-12-24.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2012-12-23/to/2013-12-22",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2012-12-23.nc',
	})
server.retrieve({
	    "class": "ei",
	    "dataset": "interim",
	    "date": "2013-12-23/to/2014-12-22",
	    "expver": "1",
	    "grid": "0.75/0.75",
	    "levtype": "sfc",
	    "param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168.128/169.128/228.128",
	    "step": "6",
	    "stream": "oper",
	    "time": "00:00:00/12:00:00",
	    "type": "fc",
	    "format"	: "netcdf",
	    "target"	: '2013-12-23.nc',
	})

